From: W.C.A. Wijngaards Date: Tue, 14 Apr 2026 13:34:59 +0000 (+0200) Subject: - Fix #1017: memory corruption related core dumps. X-Git-Tag: release-1.25.0rc1~37 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=5ce0bf5281d15b0a6f0d3ecef3c7f5c301def08c;p=thirdparty%2Funbound.git - Fix #1017: memory corruption related core dumps. When alloc_reg_obtain has an empty list, return a new allocation. --- diff --git a/doc/Changelog b/doc/Changelog index 9e38cc515..761e2a4f6 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +14 April 2026: Wouter + - Fix #1017: memory corruption related core dumps. + When alloc_reg_obtain has an empty list, return a new allocation. + 13 April 2026: Yorgos - Update the documentation of 'max-query-restarts' in the man page. diff --git a/util/alloc.c b/util/alloc.c index 9a99246f5..e4e1aeb4d 100644 --- a/util/alloc.c +++ b/util/alloc.c @@ -328,7 +328,7 @@ size_t alloc_get_mem(struct alloc_cache* alloc) struct regional* alloc_reg_obtain(struct alloc_cache* alloc) { - if(alloc->num_reg_blocks > 0) { + if(alloc->num_reg_blocks > 0 && alloc->reg_list) { struct regional* r = alloc->reg_list; alloc->reg_list = (struct regional*)r->next; r->next = NULL;