[or-cvs] fix a seg fault when fetching rendezvous descs

Roger Dingledine arma at seul.org
Fri Nov 12 21:59:30 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	directory.c 
Log Message:
fix a seg fault when fetching rendezvous descs


Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/src/or/directory.c,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -d -r1.164 -r1.165
--- directory.c	12 Nov 2004 19:39:13 -0000	1.164
+++ directory.c	12 Nov 2004 21:59:27 -0000	1.165
@@ -314,8 +314,8 @@
   }
 }
 
-/** Queue an appropriate HTTP command on conn-\>outbuf.  The other args as in
- * directory_initiate_command.
+/** Queue an appropriate HTTP command on conn-\>outbuf.  The other args
+ * are as in directory_initiate_command.
  */
 static void
 directory_send_command(connection_t *conn, const char *platform,
@@ -371,7 +371,7 @@
       tor_assert(!payload);
 
       /* this must be true or we wouldn't be doing the lookup */
-      tor_assert(strlen(payload) <= REND_SERVICE_ID_LEN);
+      tor_assert(strlen(resource) <= REND_SERVICE_ID_LEN);
       /* This breaks the function abstraction. */
       strlcpy(conn->rend_query, resource, sizeof(conn->rend_query));
 
@@ -391,7 +391,7 @@
            httpcommand,
            proxystring,
            url,
-           (unsigned long)payload_len,
+           payload ? (unsigned long)payload_len : 0,
            hoststring);
   connection_write_to_buf(tmp, strlen(tmp), conn);
 



More information about the tor-commits mailing list