]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_resolver_unbound: Test for NULL ub_result in unbound_resolver_callback
authorGeorge Joseph <gjoseph@sangoma.com>
Mon, 12 Aug 2024 17:58:12 +0000 (11:58 -0600)
committerasterisk-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Thu, 5 Sep 2024 16:32:32 +0000 (16:32 +0000)
commit2f5b143b08c8559889affdec634b7fdd470e8b5e
treeda41dcb066f6815a415e0899faaa43c471da7cd2
parent2070bb54ced0a596dcc88536d1cc08855ff44b97
res_resolver_unbound: Test for NULL ub_result in unbound_resolver_callback

The ub_result pointer passed to unbound_resolver_callback by
libunbound can be NULL if the query was for something malformed
like `.1` or `[.1]`.  If it is, we now set a 'ns_r_formerr' result
and return instead of crashing with a SEGV.  This causes pjproject
to simply cancel the transaction with a "No answer record in the DNS
response" error.  The existing "off nominal" unit test was also
updated to check this condition.

Although not necessary for this fix, we also made
ast_dns_resolver_completed() tolerant of a NULL result.

Resolves: GHSA-v428-g3cw-7hv9
main/dns_core.c
res/res_resolver_unbound.c