From: W.C.A. Wijngaards Date: Mon, 3 Jul 2023 11:50:39 +0000 (+0200) Subject: - Fix dereference of NULL variable warning in mesh_do_callback. X-Git-Tag: release-1.18.0rc1~24^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5aa47fb1fafe62f132fa858aae262fd541300ae9;p=thirdparty%2Funbound.git - Fix dereference of NULL variable warning in mesh_do_callback. --- diff --git a/doc/Changelog b/doc/Changelog index b383b023c..34fcb1fba 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -4,6 +4,7 @@ 3 July 2023: Wouter - Fix #906: warning: ‘Py_SetProgramName’ is deprecated. + - Fix dereference of NULL variable warning in mesh_do_callback. 29 June 2023: George - More fixes for reference counting for python module and clean up diff --git a/services/mesh.c b/services/mesh.c index 53bbbfc21..0c920a16a 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -1173,7 +1173,7 @@ mesh_do_callback(struct mesh_state* m, int rcode, struct reply_info* rep, else secure = 0; if(!rep && rcode == LDNS_RCODE_NOERROR) rcode = LDNS_RCODE_SERVFAIL; - if(!rcode && (rep->security == sec_status_bogus || + if(!rcode && rep && (rep->security == sec_status_bogus || rep->security == sec_status_secure_sentinel_fail)) { if(!(reason = errinf_to_str_bogus(&m->s))) rcode = LDNS_RCODE_SERVFAIL; @@ -1213,7 +1213,8 @@ mesh_do_callback(struct mesh_state* m, int rcode, struct reply_info* rep, } else { fptr_ok(fptr_whitelist_mesh_cb(r->cb)); (*r->cb)(r->cb_arg, LDNS_RCODE_NOERROR, r->buf, - rep->security, reason, was_ratelimited); + (rep?rep->security:sec_status_unchecked), + reason, was_ratelimited); } } free(reason);