From 0194a265fe0107e6a9cfbcd5e11ee4d6d592bd3b Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Tue, 9 Sep 2025 12:55:06 -0700 Subject: [PATCH] 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. --- lib/ns/query.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ns/query.c b/lib/ns/query.c index a89d6342e2..0a5a8c1b8c 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));