From: W.C.A. Wijngaards Date: Tue, 9 Jun 2026 14:41:37 +0000 (+0200) Subject: - Fix unit test for ecs to check for malloc success. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e7a713a525e01eb2755ee382574525fec440ccd2;p=thirdparty%2Funbound.git - Fix unit test for ecs to check for malloc success. --- diff --git a/doc/Changelog b/doc/Changelog index 7c62f538a..e1c7bdb93 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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 diff --git a/testcode/unitecs.c b/testcode/unitecs.c index 68d6907f8..1f3c63b0f 100644 --- a/testcode/unitecs.c +++ b/testcode/unitecs.c @@ -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); }