[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] let hidden service descriptors publish 0 intro points
Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or
Modified Files:
rendcommon.c
Log Message:
let hidden service descriptors publish 0 intro points
nick, please check the logic here
Index: rendcommon.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rendcommon.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- rendcommon.c 29 Jun 2005 21:46:55 -0000 1.51
+++ rendcommon.c 22 Jul 2005 00:14:58 -0000 1.52
@@ -72,14 +72,14 @@
set_uint16(cp, htons((uint16_t)desc->n_intro_points));
cp += 2;
if (version == 0) {
- tor_assert(desc->intro_points);
for (i=0; i < desc->n_intro_points; ++i) {
char *ipoint = (char*)desc->intro_points[i];
strlcpy(cp, ipoint, *len_out-(cp-*str_out));
cp += strlen(ipoint)+1;
}
} else {
- tor_assert(desc->intro_point_extend_info);
+ if (desc->n_intro_points)
+ tor_assert(desc->intro_point_extend_info);
for (i=0; i < desc->n_intro_points; ++i) {
extend_info_t *info = desc->intro_point_extend_info[i];
int klen;
@@ -144,9 +144,9 @@
}
if (end-cp < 2) goto truncated;
result->n_intro_points = ntohs(get_uint16(cp));
-
cp += 2;
- if (version == 0) {
+
+ if (version == 0 && result->n_intro_points != 0) {
result->intro_points = tor_malloc_zero(sizeof(char*)*result->n_intro_points);
for (i=0;i<result->n_intro_points;++i) {
if (end-cp < 2) goto truncated;
@@ -155,7 +155,7 @@
result->intro_points[i] = tor_strdup(cp);
cp = eos+1;
}
- } else {
+ } else if (version != 0 && result->n_intro_points != 0) {
result->intro_point_extend_info =
tor_malloc_zero(sizeof(extend_info_t*)*result->n_intro_points);
result->intro_points = tor_malloc_zero(sizeof(char*)*result->n_intro_points);