X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/59241d98166c2cbfe19dd1fa194212fccacc7dc0..2fd7b16acb63b86d7291abb4c68c27e24bc50a85:/print-snmp.c diff --git a/print-snmp.c b/print-snmp.c index 2819e855..d975b427 100644 --- a/print-snmp.c +++ b/print-snmp.c @@ -66,6 +66,7 @@ #include #include +#include #ifdef USE_LIBSMI #include @@ -531,7 +532,7 @@ asn1_parse(netdissect_options *ndo, break; case INTEGER: { - int32_t data; + uint32_t data; elem->type = BE_INT; data = 0; @@ -540,7 +541,7 @@ asn1_parse(netdissect_options *ndo, goto invalid; } if (GET_U_1(p) & ASN_BIT8) /* negative */ - data = -1; + data = UINT_MAX; for (i = elem->asnlen; i != 0; p++, i--) data = (data << ASN_SHIFT8) | GET_U_1(p); elem->data.integer = data; @@ -726,7 +727,8 @@ asn1_print(netdissect_options *ndo, break; case BE_OID: { - int o = 0, first = -1; + int first = -1; + uint32_t o = 0; p = (const u_char *)elem->data.raw; i = asnlen; @@ -1068,7 +1070,7 @@ smi_print_value(netdissect_options *ndo, } if (NOTIFY_CLASS(pduid) && smiNode->access < SMI_ACCESS_NOTIFY) { - ND_PRINT("[notNotifyable]"); + ND_PRINT("[notNotifiable]"); } if (READ_CLASS(pduid) && smiNode->access < SMI_ACCESS_READ_ONLY) { @@ -1197,7 +1199,7 @@ varbind_print(netdissect_options *ndo, u_short pduid, const u_char *np, u_int length) { struct be elem; - int count = 0, ind; + int count = 0; #ifdef USE_LIBSMI SmiNode *smiNode = NULL; #endif @@ -1217,7 +1219,7 @@ varbind_print(netdissect_options *ndo, length = elem.asnlen; np = (const u_char *)elem.data.raw; - for (ind = 1; length > 0; ind++) { + while (length) { const u_char *vbend; u_int vblength;