bind9/lib/ns
Michał Kępień ba1306bfb4 Check for NULL before dereferencing qctx->rpz_st
Commit 9ffb4a7ba1 causes 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 commit 07592d1315)
(cherry picked from commit a4547a1093)
2023-01-09 13:57:44 +01:00
..
include Propagate the shutdown event to the recursing ns_client(s) 2022-12-07 18:09:40 +01:00
tests Update sources to Clang 15 formatting 2022-11-29 10:30:34 +01:00
win32 Propagate the shutdown event to the recursing ns_client(s) 2022-12-07 18:09:40 +01:00
client.c Propagate the shutdown event to the recursing ns_client(s) 2022-12-07 18:09:40 +01:00
hooks.c Update sources to Clang 15 formatting 2022-11-29 10:30:34 +01:00
interfacemgr.c Propagate the shutdown event to the recursing ns_client(s) 2022-12-07 18:09:40 +01:00
Kyuafile Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
lib.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
listenlist.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
log.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
Makefile.in Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
notify.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
query.c Check for NULL before dereferencing qctx->rpz_st 2023-01-09 13:57:44 +01:00
server.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
sortlist.c Update sources to Clang 15 formatting 2022-11-29 10:30:34 +01:00
stats.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
update.c Extend dns_db_allrdatasets to control interation results 2022-12-08 11:20:35 +11:00
version.c Update the copyright information in all files in the repository 2022-01-11 12:22:09 +01:00
xfrout.c Update sources to Clang 15 formatting 2022-11-29 10:30:34 +01:00