mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
fix integer underflow in tor_vsnprintf()
(probably exploitable) svn:r3011
This commit is contained in:
parent
185f047450
commit
531c060b36
@ -90,12 +90,14 @@ int tor_snprintf(char *str, size_t size, const char *format, ...)
|
||||
return r;
|
||||
}
|
||||
|
||||
/** Replacement for vsnpritnf; behavior differs as tor_snprintf differs from
|
||||
/** Replacement for vsnprintf; behavior differs as tor_snprintf differs from
|
||||
* snprintf.
|
||||
*/
|
||||
int tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
|
||||
{
|
||||
int r;
|
||||
if (size == 0)
|
||||
return -1; /* no place for the NUL */
|
||||
#ifdef MS_WINDOWS
|
||||
r = _vsnprintf(str, size, format, args);
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user