mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 10:39:59 -04:00
Check for NULL before dereferencing qctx->rpz_st
Commit9ffb4a7ba1causes Clang Static Analyzer to flag a potential NULL dereference in query_nxdomain(): query.c:9394:26: warning: Dereference of null pointer [core.NullDereference] if (!qctx->nxrewrite || qctx->rpz_st->m.rpz->addsoa) { ^~~~~~~~~~~~~~~~~~~ 1 warning generated. The warning above is for qctx->rpz_st potentially being a NULL pointer when query_nxdomain() is called from query_resume(). This is a false positive because none of the database lookup result codes currently causing query_nxdomain() to be called (DNS_R_EMPTYWILD, DNS_R_NXDOMAIN) can be returned by a database lookup following a recursive resolution attempt. Add a NULL check nevertheless in order to future-proof the code and silence Clang Static Analyzer. (cherry picked from commit07592d1315)
This commit is contained in:
parent
f92b3b496f
commit
a4547a1093
1 changed files with 3 additions and 1 deletions
|
|
@ -9600,7 +9600,9 @@ 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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue