summaryrefslogtreecommitdiffstats
path: root/print-domain.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:52:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:52:33 +0000
commit7ba700b7f6e5fb17d280e2b8a3ae28866777715f (patch)
tree2f538ff3d975beabb6c371d999b1ee6e8b91cfb5 /print-domain.c
parentReleasing progress-linux version 4.99.4-4~progress7.99u1. (diff)
downloadtcpdump-7ba700b7f6e5fb17d280e2b8a3ae28866777715f.tar.xz
tcpdump-7ba700b7f6e5fb17d280e2b8a3ae28866777715f.zip
Merging upstream version 4.99.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--print-domain.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/print-domain.c b/print-domain.c
index d2275a5..7ac891f 100644
--- a/print-domain.c
+++ b/print-domain.c
@@ -21,9 +21,7 @@
/* \summary: Domain Name System (DNS) printer */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
@@ -839,6 +837,10 @@ ns_rprint(netdissect_options *ndo,
case T_URI:
if (!ND_TTEST_LEN(cp, len))
return(NULL);
+ if (len < 4) {
+ ND_PRINT(" len %u is too short (< 4)", len);
+ break;
+ }
ND_PRINT(" %u %u ", GET_BE_U_2(cp), GET_BE_U_2(cp + 2));
if (nd_printn(ndo, cp + 4, len - 4, ndo->ndo_snapend))
return(NULL);
@@ -1070,8 +1072,7 @@ domain_print(netdissect_options *ndo,
if (arcount)
goto trunc;
}
- }
- else {
+ } else {
/* this is a request */
ND_PRINT("%u%s%s%s", GET_BE_U_2(np->id),
ns_ops[DNS_OPCODE(flags)],
@@ -1088,8 +1089,7 @@ domain_print(netdissect_options *ndo,
ND_PRINT(" [%uq]", qdcount);
if (ancount != 1)
ND_PRINT(" [%ua]", ancount);
- }
- else {
+ } else {
if (ancount)
ND_PRINT(" [%ua]", ancount);
if (qdcount != 1)