]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix to protect custom regional create against small values.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 11 Oct 2021 15:23:30 +0000 (17:23 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 11 Oct 2021 15:23:30 +0000 (17:23 +0200)
doc/Changelog
util/regional.c

index 6e7abc812cf7c627ff303a4fd61892713d119049..fe4b81f15a4b09b5e8838ade5b92b968b8027fad 100644 (file)
@@ -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.
index bd67ecf50af348796beb00c6acdd57fcc93069f9..93e911c5ec1abbe36bfc7c062a57a7023672bf65 100644 (file)
@@ -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);
 }