X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/f67e46a634dd3bdcefa9fc09dbef6baae1b1d1ed..4c683712d4b483b43f16d41d09ec6232cbc917ca:/print-bootp.c diff --git a/print-bootp.c b/print-bootp.c index b20dabc6..d84ba6f8 100644 --- a/print-bootp.c +++ b/print-bootp.c @@ -394,9 +394,9 @@ trunc: * The first character specifies the format to print: * i - ip address (32 bits) * p - ip address pairs (32 bits + 32 bits) - * l - long (32 bits) - * L - unsigned long (32 bits) - * s - short (16 bits) + * l - unsigned longs (32 bits) + * L - longs (32 bits) + * s - unsigned shorts (16 bits) * b - period-separated decimal bytes (variable length) * x - colon-separated hex bytes (variable length) * a - ASCII string (variable length) @@ -717,7 +717,7 @@ rfc1048_print(netdissect_options *ndo, break; case 's': - /* shorts */ + /* unsigned shorts */ while (len >= 2) { if (!first) ND_PRINT(","); @@ -1012,22 +1012,24 @@ rfc1048_print(netdissect_options *ndo, * URI: URI of the SZTP bootstrap server. */ while (len >= 2) { - suboptlen = GET_BE_U_2(bp); + uint16_t suboptlen2; + + suboptlen2 = GET_BE_U_2(bp); bp += 2; len -= 2; ND_PRINT("\n\t "); - ND_PRINT("length %u: ", suboptlen); - if (len < suboptlen) { + ND_PRINT("length %u: ", suboptlen2); + if (len < suboptlen2) { ND_PRINT("length goes past end of option"); bp += len; len = 0; break; } ND_PRINT("\""); - nd_printjn(ndo, bp, suboptlen); + nd_printjn(ndo, bp, suboptlen2); ND_PRINT("\""); - len -= suboptlen; - bp += suboptlen; + len -= suboptlen2; + bp += suboptlen2; } if (len != 0) { ND_PRINT("[ERROR: length < 2 bytes]");