]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix dereference of NULL variable warning in mesh_do_callback.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 3 Jul 2023 11:50:39 +0000 (13:50 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 3 Jul 2023 11:50:39 +0000 (13:50 +0200)
doc/Changelog
services/mesh.c

index b383b023c97815fff7d6743e9fc37c28b6ff815e..34fcb1fbabca402a1c329ad82a6c0d6bf05d8875 100644 (file)
@@ -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
index 53bbbfc21d99d4d4ad79f1ea349a508b618fdaf7..0c920a16aa9412356317150894ceb7c14785453d 100644 (file)
@@ -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);