[or-cvs] anonymous bugfix on our pointer arithmetic

arma at seul.org arma at seul.org
Tue Jul 12 22:56:08 UTC 2005


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

Modified Files:
	dirserv.c 
Log Message:
anonymous bugfix on our pointer arithmetic


Index: dirserv.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -d -r1.171 -r1.172
--- dirserv.c	27 Jun 2005 22:25:09 -0000	1.171
+++ dirserv.c	12 Jul 2005 22:56:06 -0000	1.172
@@ -579,7 +579,6 @@
 dirserv_dump_directory_to_string(char **dir_out,
                                  crypto_pk_env_t *private_key)
 {
-  char *cp;
   char *router_status;
   char *identity_pkey; /* Identity key, DER64-encoded. */
   char *recommended_versions;
@@ -646,8 +645,6 @@
   tor_free(recommended_versions);
   tor_free(router_status);
   tor_free(identity_pkey);
-  i = strlen(buf);
-  cp = buf+i;
 
   SMARTLIST_FOREACH(descriptor_list, routerinfo_t *, ri,
     if (strlcat(buf, ri->signed_descriptor, buf_len) >= buf_len)
@@ -675,12 +672,11 @@
   }
   log(LOG_DEBUG,"generated directory digest begins with %s",hex_str(digest,4));
 
-  if (strlcat(cp, "-----BEGIN SIGNATURE-----\n", buf_len) >= buf_len)
+  if (strlcat(buf, "-----BEGIN SIGNATURE-----\n", buf_len) >= buf_len)
     goto truncated;
 
   i = strlen(buf);
-  cp = buf+i;
-  if (base64_encode(cp, buf_len-i, signature, 128) < 0) {
+  if (base64_encode(buf+i, buf_len-i, signature, 128) < 0) {
     log_fn(LOG_WARN,"couldn't base64-encode signature");
     tor_free(buf);
     return -1;



More information about the tor-commits mailing list