Merge remote-tracking branch 'dop/topic/dopheide/vfmt-buf_len'

* dop/topic/dopheide/vfmt-buf_len:
  Fix logic error in vfmt() when growing the buffer
This commit is contained in:
Tim Wojtulewicz 2022-11-21 09:10:28 -07:00
commit c1e5389929
3 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,7 @@
5.2.0-dev.352 | 2022-11-21 09:10:28 -0700
* Fix logic error in vfmt() when growing the buffer (Michael Dopheide)
5.2.0-dev.350 | 2022-11-21 09:09:09 -0700 5.2.0-dev.350 | 2022-11-21 09:09:09 -0700
* Added NTLM challenge and response (nadavkluger) * Added NTLM challenge and response (nadavkluger)

View file

@ -1 +1 @@
5.2.0-dev.350 5.2.0-dev.352

View file

@ -1630,7 +1630,7 @@ const char* vfmt(const char* format, va_list al)
va_copy(alc, al); va_copy(alc, al);
int n = vsnprintf(buf, buf_len, format, al); int n = vsnprintf(buf, buf_len, format, al);
if ( n > 0 && buf_len < n ) if ( n > 0 && buf_len <= n )
{ // Not enough room, grow the buffer. { // Not enough room, grow the buffer.
buf_len = n + 32; buf_len = n + 32;
buf = (char*)safe_realloc(buf, buf_len); buf = (char*)safe_realloc(buf, buf_len);