Fix assert in dig when using +sigchase (#985918)

Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
Tomas Hozza 2014-10-02 16:26:05 +02:00
parent 1407f656a4
commit 23b1421845
2 changed files with 86 additions and 0 deletions

View File

@ -82,6 +82,7 @@ Patch130:bind-9.9.1-P2-dlz-libdb.patch
Patch131:bind-9.9.1-P2-multlib-conflict.patch
Patch133:bind99-rh640538.patch
Patch134:bind97-rh669163.patch
Patch135:bind99-rh985918.patch
# SDB patches
Patch11: bind-9.3.2b2-sdbsrc.patch
@ -321,6 +322,7 @@ cp -fp contrib/sdb/sqlite/zone2sqlite.c bin/sdb_tools
%endif
%patch133 -p1 -b .rh640538
%patch134 -p1 -b .rh669163
%patch135 -p1 -b .rh985918
# Sparc and s390 arches need to use -fPIE
%ifarch sparcv9 sparc64 s390 s390x
@ -920,6 +922,7 @@ rm -rf ${RPM_BUILD_ROOT}
- Update to 9.9.6
- drop merged patches and rebase some of existing patches
- Add architecture specific dependencies.
- Fix assert in dig when using +sigchase (#985918)
* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 32:9.9.5-9.P1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

83
bind99-rh985918.patch Normal file
View File

@ -0,0 +1,83 @@
From 7d891eaf911e5cab1f704615f8f1ef87c8716f46 Mon Sep 17 00:00:00 2001
From: Mark Andrews <marka@isc.org>
Date: Wed, 1 Oct 2014 10:01:54 +1000
Subject: [PATCH] 3962. [bug] 'dig +topdown +trace +sigchase'
address unhandled error conditions. [RT #34663]
---
bin/dig/dighost.c | 31 ++++++++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
index c99dcfc..aeded9e 100644
--- a/bin/dig/dighost.c
+++ b/bin/dig/dighost.c
@@ -56,6 +56,7 @@
#include <dns/log.h>
#include <dns/message.h>
#include <dns/name.h>
+#include <dns/rcode.h>
#include <dns/rdata.h>
#include <dns/rdataclass.h>
#include <dns/rdatalist.h>
@@ -4489,6 +4490,9 @@ chase_scanname_section(dns_message_t *msg, dns_name_t *name,
dns_rdataset_t *rdataset;
dns_name_t *msg_name = NULL;
+ if (msg->counts[section] == 0)
+ return (NULL);
+
do {
dns_message_currentname(msg, section, &msg_name);
if (dns_name_compare(msg_name, name) == 0) {
@@ -5297,6 +5301,20 @@ sigchase_td(dns_message_t *msg)
isc_boolean_t have_answer = ISC_FALSE;
isc_boolean_t true = ISC_TRUE;
+ if (msg->rcode != dns_rcode_noerror &&
+ msg->rcode != dns_rcode_nxdomain) {
+ char buf[20];
+ isc_buffer_t b;
+
+ isc_buffer_init(&b, buf, sizeof(buf));
+ result = dns_rcode_totext(msg->rcode, &b);
+ check_result(result, "dns_rcode_totext failed");
+ printf("error response code %.*s\n",
+ (int)isc_buffer_usedlength(&b), buf);
+ error_message = msg;
+ return;
+ }
+
if ((result = dns_message_firstname(msg, DNS_SECTION_ANSWER))
== ISC_R_SUCCESS) {
dns_message_currentname(msg, DNS_SECTION_ANSWER, &name);
@@ -5309,10 +5327,13 @@ sigchase_td(dns_message_t *msg)
if (!current_lookup->trace_root_sigchase) {
result = dns_message_firstname(msg,
DNS_SECTION_AUTHORITY);
- if (result == ISC_R_SUCCESS)
- dns_message_currentname(msg,
- DNS_SECTION_AUTHORITY,
- &name);
+ if (result != ISC_R_SUCCESS) {
+ printf("no answer or authority section\n");
+ error_message = msg;
+ return;
+ }
+ dns_message_currentname(msg, DNS_SECTION_AUTHORITY,
+ &name);
chase_nsrdataset
= chase_scanname_section(msg, name,
dns_rdatatype_ns,
@@ -5322,7 +5343,7 @@ sigchase_td(dns_message_t *msg)
if (chase_nsrdataset != NULL) {
have_delegation_ns = ISC_TRUE;
printf("no response but there is a delegation"
- " in authority section:");
+ " in authority section: ");
dns_name_print(name, stdout);
printf("\n");
} else {
--
1.8.2.3