From: W.C.A. Wijngaards Date: Fri, 27 Mar 2026 14:39:27 +0000 (+0100) Subject: - Fix test code to allow empty hex answer packets from testbound. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a0ec6cd9469b2b8b711c49029e0fb3e7653a5994;p=thirdparty%2Funbound.git - Fix test code to allow empty hex answer packets from testbound. --- diff --git a/doc/Changelog b/doc/Changelog index 31216df8c..1d0e2add1 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 27 March 2026: Wouter - Fix to allow the control-interface config to use ip@port notation. + - Fix test code to allow empty hex answer packets from testbound. 24 March 2026: Wouter - Fix to check for invalid http content length and chunk size, diff --git a/testcode/testpkts.c b/testcode/testpkts.c index 8b92df2e7..93f2add94 100644 --- a/testcode/testpkts.c +++ b/testcode/testpkts.c @@ -1774,11 +1774,14 @@ adjust_packet(struct entry* match, uint8_t** answer_pkt, size_t *answer_len, memmove(res+LDNS_HEADER_SIZE+dlen+4, orig+LDNS_HEADER_SIZE+olen+4, reslen-(LDNS_HEADER_SIZE+dlen+4)); + } else if(origlen == 0) { + res = NULL; + reslen = 0; } else { res = memdup(orig, origlen); reslen = origlen; } - if(!res) { + if(!res && reslen > 0) { verbose(1, "out of memory; send without adjust\n"); return; }