X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/61c422a88caefe986c2bc0a7f2f3028f696fa5cd..1a04b92e365f5ed01ca38619b41bcc4fc9cbd63c:/print-isakmp.c diff --git a/print-isakmp.c b/print-isakmp.c index e5563631..a2683ac6 100644 --- a/print-isakmp.c +++ b/print-isakmp.c @@ -862,7 +862,7 @@ hexprint(netdissect_options *ndo, const uint8_t *loc, size_t len) static int rawprint(netdissect_options *ndo, const uint8_t *loc, size_t len) { - ND_TCHECK2(*loc, len); + ND_TCHECK_LEN(loc, len); hexprint(ndo, loc, len); return 1; @@ -918,8 +918,8 @@ ikev1_attrmap_print(netdissect_options *ndo, int totlen; uint32_t t, v; - ND_TCHECK(p[0]); - if (p[0] & 0x80) + ND_TCHECK_1(p); + if (EXTRACT_U_1(p) & 0x80) totlen = 4; else { ND_TCHECK_2(p + 2); @@ -937,7 +937,7 @@ ikev1_attrmap_print(netdissect_options *ndo, ND_PRINT((ndo,"type=%s ", map[t].type)); else ND_PRINT((ndo,"type=#%d ", t)); - if (p[0] & 0x80) { + if (EXTRACT_U_1(p) & 0x80) { ND_PRINT((ndo,"value=")); ND_TCHECK_2(p + 2); v = EXTRACT_BE_U_2(p + 2); @@ -969,8 +969,8 @@ ikev1_attr_print(netdissect_options *ndo, const u_char *p, const u_char *ep2) int totlen; uint32_t t; - ND_TCHECK(p[0]); - if (p[0] & 0x80) + ND_TCHECK_1(p); + if (EXTRACT_U_1(p) & 0x80) totlen = 4; else { ND_TCHECK_2(p + 2); @@ -985,9 +985,9 @@ ikev1_attr_print(netdissect_options *ndo, const u_char *p, const u_char *ep2) ND_PRINT((ndo,"(")); t = EXTRACT_BE_U_2(p) & 0x7fff; ND_PRINT((ndo,"type=#%d ", t)); - if (p[0] & 0x80) { + if (EXTRACT_U_1(p) & 0x80) { ND_PRINT((ndo,"value=")); - t = p[2]; + t = EXTRACT_U_1(p + 2); if (!rawprint(ndo, (const uint8_t *)(p + 2), 2)) { ND_PRINT((ndo,")")); goto trunc; @@ -1048,7 +1048,7 @@ ikev1_sa_print(netdissect_options *ndo, u_char tpay _U_, np = (const u_char *)ext + sizeof(sa); if (sit != 0x01) { - ND_TCHECK2(*(ext + 1), sizeof(ident)); + ND_TCHECK_LEN(ext + 1, sizeof(ident)); UNALIGNED_MEMCPY(&ident, ext + 1, sizeof(ident)); ND_PRINT((ndo," ident=%u", (uint32_t)ntohl(ident))); np += sizeof(ident); @@ -1393,7 +1393,7 @@ ikev1_id_print(netdissect_options *ndo, u_char tpay _U_, break; if (data == NULL) goto trunc; - ND_TCHECK2(*data, len); + ND_TCHECK_LEN(data, len); switch (doi_id.type) { case IPSECDOI_ID_IPV4_ADDR: if (len < 4) @@ -2044,7 +2044,7 @@ ikev2_p_print(netdissect_options *ndo, u_char tpay _U_, int pcount _U_, if (prop_length < item_len) goto toolong; - ND_TCHECK2(*cp, item_len); + ND_TCHECK_LEN(cp, item_len); depth++; ND_PRINT((ndo,"\n")); @@ -2130,7 +2130,7 @@ ikev2_sa_print(netdissect_options *ndo, u_char tpay, if (sa_length < item_len) goto toolong; - ND_TCHECK2(*cp, item_len); + ND_TCHECK_LEN(cp, item_len); depth++; ND_PRINT((ndo,"\n")); @@ -2259,7 +2259,7 @@ ikev2_ID_print(netdissect_options *ndo, u_char tpay, } if(dumpascii) { - ND_TCHECK2(*typedata, idtype_len); + ND_TCHECK_LEN(typedata, idtype_len); for(i=0; i