mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 13:53:31 +01:00
Actually do that memarea_strndup fix right. Not only must you not examine unmapped ram, but you also must not copy it. From lark.
svn:r19095
This commit is contained in:
parent
0fa01654b9
commit
be9d72303e
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user