]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix unit test for ecs to check for malloc success.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 9 Jun 2026 14:41:37 +0000 (16:41 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 9 Jun 2026 14:41:37 +0000 (16:41 +0200)
doc/Changelog
testcode/unitecs.c

index 7c62f538a42076580c2a32ef9a77f9d7319a4f53..e1c7bdb934caad2c8676f8e575b37bcc1d399a8a 100644 (file)
@@ -1,3 +1,6 @@
+9 June 2026: Wouter
+       - Fix unit test for ecs to check for malloc success.
+
 3 June 2026: Wouter
        - Fix that the processing of class responses does not have
          a heap use-after-free. That could happen if at least two
index 68d6907f81a75b0df588bcd023100568e6d8d898..1f3c63b0f02626c875497b3d64ea60a3e8fb8e08 100644 (file)
@@ -141,6 +141,7 @@ static addrlen_t randomkey(addrkey_t **k, int maxlen)
        int bits = rand() % maxlen;
        int bytes = bits/8 + (bits%8>0); /*ceil*/
        *k = (addrkey_t *) malloc(bytes * sizeof(addrkey_t));
+       if(!*k) fatal_exit("out of memory");
        for (byte = 0; byte < bytes; byte++) {
                (*k)[byte] = (addrkey_t)(rand() & 0xFF);
        }