From: Wouter Wijngaards Date: Thu, 22 Nov 2018 15:07:30 +0000 (+0000) Subject: - Fix #4209: Crash in libunbound when called from getdns. X-Git-Tag: release-1.8.2rc1~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c97bb52d7731740c2aa46f8ca7fbed5ebbc27af9;p=thirdparty%2Funbound.git - Fix #4209: Crash in libunbound when called from getdns. git-svn-id: file:///svn/unbound/trunk@4971 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 265a34797..e056a4a33 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,7 @@ - pythonmod logs the python error and traceback on failure. - ignore debug python module for test in doxygen output. - review fixes for python module. + - Fix #4209: Crash in libunbound when called from getdns. 21 November 2018: Wouter - Scrub NS records from NODATA responses as well. diff --git a/libunbound/libworker.c b/libunbound/libworker.c index 065f0a7b1..a886f9a88 100644 --- a/libunbound/libworker.c +++ b/libunbound/libworker.c @@ -657,8 +657,8 @@ libworker_event_done_cb(void* arg, int rcode, sldns_buffer* buf, sec = 1; else if(s == sec_status_secure) sec = 2; - (*cb)(cb_arg, rcode, (void*)sldns_buffer_begin(buf), - (int)sldns_buffer_limit(buf), sec, why_bogus, was_ratelimited); + (*cb)(cb_arg, rcode, (buf?(void*)sldns_buffer_begin(buf):NULL), + (buf?(int)sldns_buffer_limit(buf):0), sec, why_bogus, was_ratelimited); } }