]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-snmp.c
Use more the ND_TCHECK_1() macro
[tcpdump] / print-snmp.c
index 99df847665bd0723346b022f9a38425f5cf777dd..7a0332780c634fc228ded444123320a40ec7f771 100644 (file)
@@ -465,7 +465,7 @@ asn1_parse(netdissect_options *ndo,
                 */
                id = 0;
                ND_TCHECK(*p);
-               while (*p & ASN_BIT8) {
+               while (EXTRACT_U_1(p) & ASN_BIT8) {
                        if (len < 1) {
                                ND_PRINT((ndo, "[Xtagfield?]"));
                                return -1;
@@ -682,7 +682,7 @@ asn1_print_octets(netdissect_options *ndo, struct be *elem)
 
        ND_TCHECK2(*p, asnlen);
        for (i = asnlen; i-- > 0; p++)
-               ND_PRINT((ndo, "_%.2x", *p));
+               ND_PRINT((ndo, "_%.2x", EXTRACT_U_1(p)));
        return 0;
 
 trunc:
@@ -712,7 +712,7 @@ asn1_print_string(netdissect_options *ndo, struct be *elem)
                ND_PRINT((ndo, "\""));
        } else {
                for (i = asnlen; i-- > 0; p++) {
-                       ND_PRINT((ndo, first ? "%.2x" : "_%.2x", *p));
+                       ND_PRINT((ndo, first ? "%.2x" : "_%.2x", EXTRACT_U_1(p)));
                        first = 0;
                }
        }
@@ -825,7 +825,7 @@ asn1_print(netdissect_options *ndo,
                p = (const u_char *)elem->data.raw;
                ND_TCHECK2(*p, asnlen);
                for (i = asnlen; i-- != 0; p++) {
-                       ND_PRINT((ndo, (i == asnlen-1) ? "%u" : ".%u", *p));
+                       ND_PRINT((ndo, (i == asnlen-1) ? "%u" : ".%u", EXTRACT_U_1(p)));
                }
                break;