Project

General

Profile

Bug #3 ยป 0003-Reserve-space-for-terminating-NULL-on-astr_buffer.patch

Marko Lindqvist, 11/28/2023 02:47 AM

View differences:

utility/astring.c
va_copy(copy, ap);
req_len = fc_vsnprintf(buffer, buffer_size, format, ap);
if (req_len > buffer_size) {
buffer = astr_buffer_grow(req_len, &buffer_size);
if (req_len + 1 > buffer_size) {
buffer = astr_buffer_grow(req_len + 1, &buffer_size);
/* Even if buffer is *still* too small, we fill what we can */
req_len = fc_vsnprintf(buffer, buffer_size, format, copy);
if (req_len > buffer_size) {
    (1-1/1)