[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Strdup hates finding 0 bytes.



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv23726/src/or

Modified Files:
	rendcommon.c 
Log Message:
Strdup hates finding 0 bytes.

Index: rendcommon.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendcommon.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- rendcommon.c	3 Apr 2004 03:37:11 -0000	1.14
+++ rendcommon.c	3 Apr 2004 03:39:31 -0000	1.15
@@ -246,7 +246,8 @@
   }
   e->parsed = parsed;
   e->len = desc_len;
-  e->desc = tor_strdup(desc);
+  e->desc = tor_malloc(desc_len);
+  memcpy(e->desc, desc, desc_len);
 
   log_fn(LOG_INFO,"Successfully stored rend desc '%s', len %d", query, desc_len);
   return 0;