From ecb0b44ba82d71c818a6a8f9304373ee79e4b5c3 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Mon, 11 Oct 2021 17:23:30 +0200 Subject: [PATCH] - Fix to protect custom regional create against small values. --- doc/Changelog | 1 + util/regional.c | 2 ++ 2 files changed, 3 insertions(+) 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); } -- 2.47.3