]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix Integer Underflow in Regional Allocator,
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 20 Nov 2019 12:00:56 +0000 (13:00 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 20 Nov 2019 12:00:56 +0000 (13:00 +0100)
  reported by X41 D-Sec.

doc/Changelog
util/regional.c

index cda8f1df664ba560bb63f0408e6da08afe3084e3..c72a255bf5c7109c4b1d22fe4db3d0e338fef10f 100644 (file)
@@ -16,6 +16,8 @@
          reported by X41 D-Sec.
        - Fix Local Memory Leak in cachedb_init(),
          reported by X41 D-Sec.
+       - Fix Integer Underflow in Regional Allocator,
+         reported by X41 D-Sec.
 
 19 November 2019: Wouter
        - Fix CVE-2019-18934, shell execution in ipsecmod.
index 5be09eb46dc71b11916743c8f7de73792a706a32..ff36d0e212416c0dc7b695881060f28f8b0fa884 100644 (file)
@@ -84,6 +84,7 @@ struct regional*
 regional_create_custom(size_t size)
 {
        struct regional* r = (struct regional*)malloc(size);
+       size = ALIGN_UP(size, ALIGNMENT);
        log_assert(sizeof(struct regional) <= size);
        if(!r) return NULL;
        r->first_size = size;