diff --git a/lib/ns/query.c b/lib/ns/query.c index 2f0608faaa..18c6a820e1 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -9391,7 +9391,8 @@ query_nxdomain(query_ctx_t *qctx, isc_result_t res) { { ttl = 0; } - if (!qctx->nxrewrite || qctx->rpz_st->m.rpz->addsoa) { + if (!qctx->nxrewrite || + (qctx->rpz_st != NULL && qctx->rpz_st->m.rpz->addsoa)) { result = query_addsoa(qctx, ttl, section); if (result != ISC_R_SUCCESS) { QUERY_ERROR(qctx, result);