]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-domain.c
Update the "Error converting time" tests for packet times
[tcpdump] / print-domain.c
index d2275a5e2a30efdff142b6185108f6874e8a9b27..dcbd982cb4e3a520aca1bfd6e2f78512e1a2304f 100644 (file)
@@ -839,6 +839,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 +1074,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 +1091,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)