From: W.C.A. Wijngaards Date: Mon, 11 Oct 2021 15:23:30 +0000 (+0200) Subject: - Fix to protect custom regional create against small values. X-Git-Tag: release-1.14.0rc1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecb0b44ba82d71c818a6a8f9304373ee79e4b5c3;p=thirdparty%2Funbound.git - Fix to protect custom regional create against small values. --- diff --git a/doc/Changelog b/doc/Changelog index 6e7abc812..fe4b81f15 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 11 October 2021: Wouter - Fix chaos replies to have truncation for short message lengths, or long reply strings. + - Fix to protect custom regional create against small values. 4 October 2021: Wouter - Fix to add example.conf note for outbound-msg-retry. diff --git a/util/regional.c b/util/regional.c index bd67ecf50..93e911c5e 100644 --- a/util/regional.c +++ b/util/regional.c @@ -103,6 +103,8 @@ regional_create_custom_large_object(size_t size, size_t large_object_size) struct regional* regional_create_custom(size_t size) { + if(size < sizeof(struct regional)) + size = sizeof(struct regional); return regional_create_custom_large_object(size, REGIONAL_LARGE_OBJECT_SIZE); }