From cf62bb6918a5a19030a272ce7c96fb1a82248ae8 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 28 Jul 2004 20:16:50 +0000 Subject: [PATCH] pullup: 1672. [bug] libbind: failed to print unknown types and classes above 4095. didn't correctly print unknown records with zero length. --- lib/bind/nameser/ns_print.c | 7 +++---- lib/bind/resolv/res_debug.c | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/bind/nameser/ns_print.c b/lib/bind/nameser/ns_print.c index aea847daba..51592862b8 100644 --- a/lib/bind/nameser/ns_print.c +++ b/lib/bind/nameser/ns_print.c @@ -16,7 +16,7 @@ */ #ifndef lint -static const char rcsid[] = "$Id: ns_print.c,v 1.6 2004/03/18 02:58:01 marka Exp $"; +static const char rcsid[] = "$Id: ns_print.c,v 1.7 2004/07/28 20:16:49 marka Exp $"; #endif /* Import. */ @@ -145,8 +145,6 @@ ns_sprintrrf(const u_char *msg, size_t msglen, addlen(x, &buf, &buflen); len = SPRINTF((tmp, " %s %s", p_class(class), p_type(type))); T(addstr(tmp, len, &buf, &buflen)); - if (rdlen == 0U) - return (buf - obuf); T(spaced = addtab(x + len, 16, spaced, &buf, &buflen)); /* @@ -707,7 +705,8 @@ ns_sprintrrf(const u_char *msg, size_t msglen, int n, m; char *p; - len = SPRINTF((tmp, "\\# %u (\t; %s", edata - rdata, comment)); + len = SPRINTF((tmp, "\\# %u%s\t; %s", edata - rdata, + rdlen != 0 ? " (" : "", comment)); T(addstr(tmp, len, &buf, &buflen)); while (rdata < edata) { p = tmp; diff --git a/lib/bind/resolv/res_debug.c b/lib/bind/resolv/res_debug.c index 1a6108b3a1..e4b8723ad6 100644 --- a/lib/bind/resolv/res_debug.c +++ b/lib/bind/resolv/res_debug.c @@ -95,7 +95,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; -static const char rcsid[] = "$Id: res_debug.c,v 1.12 2004/04/13 07:19:18 marka Exp $"; +static const char rcsid[] = "$Id: res_debug.c,v 1.13 2004/07/28 20:16:50 marka Exp $"; #endif /* LIBC_SCCS and not lint */ #include "port_before.h" @@ -549,7 +549,7 @@ p_type(int type) { result = sym_ntos(__p_type_syms, type, &success); if (success) return (result); - if (type < 0 || type > 0xfff) + if (type < 0 || type > 0xffff) return ("BADTYPE"); sprintf(typebuf, "TYPE%d", type); return (typebuf); @@ -585,7 +585,7 @@ p_class(int class) { result = sym_ntos(__p_class_syms, class, &success); if (success) return (result); - if (class < 0 || class > 0xfff) + if (class < 0 || class > 0xffff) return ("BADCLASS"); sprintf(classbuf, "CLASS%d", class); return (classbuf);