From: Francois-Xavier Le Bail Date: Mon, 8 Dec 2014 20:24:59 +0000 (+0100) Subject: CDP: fix "Unchecked return value" found by Coverity X-Git-Tag: tcpdump-4.7.2~1^2~79 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/043784b064d03ab8223f4c02fc0ba5f9dffecabd CDP: fix "Unchecked return value" found by Coverity The bounds check is already done before by ND_TCHECK2(*tptr, len). So we are deliberately ignoring the return values of fn_printn with last argument NULL (no bounds check). --- diff --git a/print-cdp.c b/print-cdp.c index a725eb6e..109c04c7 100644 --- a/print-cdp.c +++ b/print-cdp.c @@ -147,7 +147,7 @@ cdp_print(netdissect_options *ndo, if (!ndo->ndo_vflag) ND_PRINT((ndo, ", Device-ID ")); ND_PRINT((ndo, "'")); - fn_printn(ndo, tptr, len, NULL); + (void)fn_printn(ndo, tptr, len, NULL); ND_PRINT((ndo, "'")); break; case 0x02: /* Address */ @@ -156,7 +156,7 @@ cdp_print(netdissect_options *ndo, break; case 0x03: /* Port-ID */ ND_PRINT((ndo, "'")); - fn_printn(ndo, tptr, len, NULL); + (void)fn_printn(ndo, tptr, len, NULL); ND_PRINT((ndo, "'")); break; case 0x04: /* Capabilities */ @@ -177,7 +177,7 @@ cdp_print(netdissect_options *ndo, break; case 0x06: /* Platform */ ND_PRINT((ndo, "'")); - fn_printn(ndo, tptr, len, NULL); + (void)fn_printn(ndo, tptr, len, NULL); ND_PRINT((ndo, "'")); break; case 0x07: /* Prefixes */ @@ -188,7 +188,7 @@ cdp_print(netdissect_options *ndo, break; case 0x09: /* VTP Mgmt Domain - CDPv2 */ ND_PRINT((ndo, "'")); - fn_printn(ndo, tptr, len, NULL); + (void)fn_printn(ndo, tptr, len, NULL); ND_PRINT((ndo, "'")); break; case 0x0a: /* Native VLAN ID - CDPv2 */ @@ -230,7 +230,7 @@ cdp_print(netdissect_options *ndo, break; case 0x14: /* System Name - not documented */ ND_PRINT((ndo, "'")); - fn_printn(ndo, tptr, len, NULL); + (void)fn_printn(ndo, tptr, len, NULL); ND_PRINT((ndo, "'")); break; case 0x16: /* System Object ID - not documented */ @@ -243,7 +243,7 @@ cdp_print(netdissect_options *ndo, ND_PRINT((ndo, "0x%02x", *(tptr))); if (len > 1) { ND_PRINT((ndo, "/")); - fn_printn(ndo, tptr + 1, len - 1, NULL); + (void)fn_printn(ndo, tptr + 1, len - 1, NULL); } break; default: