mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 16:15:27 +00:00
Forbid isc_buffer_printf from growing the buffer unless auto reallocation is enabled
This commit is contained in:
@@ -662,9 +662,15 @@ isc_buffer_printf(isc_buffer_t *b, const char *format, ...) {
|
|||||||
return (ISC_R_FAILURE);
|
return (ISC_R_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = isc_buffer_reserve(&b, n + 1);
|
if (ISC_UNLIKELY(b->autore)) {
|
||||||
if (result != ISC_R_SUCCESS) {
|
result = isc_buffer_reserve(&b, n + 1);
|
||||||
return (result);
|
if (result != ISC_R_SUCCESS) {
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isc_buffer_availablelength(b) < (unsigned int)n + 1) {
|
||||||
|
return (ISC_R_NOSPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
|
Reference in New Issue
Block a user