From: Evan Hunt Date: Tue, 9 Sep 2025 19:55:06 +0000 (-0700) Subject: check target pointer validity in qctx_save X-Git-Tag: v9.21.14~51^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0194a265fe0107e6a9cfbcd5e11ee4d6d592bd3b;p=thirdparty%2Fbind9.git check target pointer validity in qctx_save Make sure the target pointer address (getting the allocated instance of qctx) is valid and the pointer is NULL. --- diff --git a/lib/ns/query.c b/lib/ns/query.c index a89d6342e20..0a5a8c1b8ce 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -5229,6 +5229,8 @@ qctx_destroy(query_ctx_t *qctx) { */ static void qctx_save(query_ctx_t *src, query_ctx_t **targetp) { + REQUIRE(targetp != NULL && *targetp == NULL); + query_ctx_t *target = isc_mem_get(src->client->manager->mctx, sizeof(query_ctx_t));