]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check target pointer validity in qctx_save
authorEvan Hunt <each@isc.org>
Tue, 9 Sep 2025 19:55:06 +0000 (12:55 -0700)
committerColin Vidal <colin@isc.org>
Wed, 10 Sep 2025 10:43:05 +0000 (12:43 +0200)
Make sure the target pointer address (getting the allocated instance of
qctx) is valid and the pointer is NULL.

lib/ns/query.c

index a89d6342e2030dae3c6aedc4528ffbc92d15a18a..0a5a8c1b8ce511022f00044195c63aaf9e0843fc 100644 (file)
@@ -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));