From e52c2a654bd8ad9fe06f75ee715faea33d8adc23 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 16 Jan 2024 14:25:27 +1100 Subject: [PATCH] Clear qctx->zversion Clear qctx->zversion when clearing qctx->zrdataset et al in lib/ns/query.c:qctx_freedata. The uncleared pointer could lead to an assertion failure if zone data needed to be re-saved which could happen with stale data support enabled. --- lib/ns/query.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ns/query.c b/lib/ns/query.c index 2827fc0e0b..203ab46257 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -5411,6 +5411,7 @@ qctx_freedata(query_ctx_t *qctx) { ns_client_releasename(qctx->client, &qctx->zfname); dns_db_detachnode(qctx->zdb, &qctx->znode); dns_db_detach(&qctx->zdb); + qctx->zversion = NULL; } if (qctx->fresp != NULL && !qctx->client->nodetach) {