]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Actually do that memarea_strndup fix right. Not only must you not examine unmapped...
authorNick Mathewson <nickm@torproject.org>
Sat, 21 Mar 2009 16:01:52 +0000 (16:01 +0000)
committerNick Mathewson <nickm@torproject.org>
Sat, 21 Mar 2009 16:01:52 +0000 (16:01 +0000)
svn:r19095

src/common/memarea.c

index 7eb54821b970b31eb64c9edd242522a63e8c8f57..6e0bda0c8aaa73253c0549f0645a60919f910474 100644 (file)
@@ -241,7 +241,8 @@ memarea_strndup(memarea_t *area, const char *s, size_t n)
     ;
   /* cp now points to s+n, or to the 0 in the string. */
   ln = cp-s;
-  result = memarea_memdup(area, s, ln+1);
+  result = memarea_alloc(area, ln+1);
+  memcpy(result, s, ln);
   result[ln]='\0';
   return result;
 }