mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
src/common/compat.c:tor_vasprintf() - changed vsnprintf() to tor_vsnprintf() which ensures string is null terminated.
This commit is contained in:
parent
232ccc18c4
commit
fcc6541fde
@ -580,7 +580,8 @@ tor_vasprintf(char **strp, const char *fmt, va_list args)
|
||||
return len;
|
||||
}
|
||||
strp_tmp = tor_malloc(len+1);
|
||||
r = vsnprintf(strp_tmp, len+1, fmt, args);
|
||||
/* use of tor_vsnprintf() will ensure string is null terminated */
|
||||
r = tor_vsnprintf(strp_tmp, len+1, fmt, args);
|
||||
if (r != len) {
|
||||
tor_free(strp_tmp);
|
||||
*strp = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user