]> The Tcpdump Group git mirrors - tcpdump/commitdiff
BOOTP/DHCP: fix "Unchecked return value" found by Coverity
authorFrancois-Xavier Le Bail <[email protected]>
Tue, 9 Dec 2014 18:42:31 +0000 (19:42 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 9 Dec 2014 20:20:29 +0000 (21:20 +0100)
Add a bounds check
Fix spaces

print-bootp.c

index 27438fabe3cc538191e66968f0d1061a43a057b1..fe0a070ca093a0fb26742fb5a8145f27f92620d4 100644 (file)
@@ -851,7 +851,7 @@ rfc1048_print(netdissect_options *ndo,
 
                        case TAG_CLIENT_ID:
                            {
-                               int type;
+                               int type;
 
                                /* this option should be at least 1 byte long */
                                if (len < 1) {
@@ -907,7 +907,8 @@ rfc1048_print(netdissect_options *ndo,
                                        case AGENT_SUBOPTION_CIRCUIT_ID: /* fall through */
                                        case AGENT_SUBOPTION_REMOTE_ID:
                                        case AGENT_SUBOPTION_SUBSCRIBER_ID:
-                                               fn_printn(ndo, bp, suboptlen, NULL);
+                                               if (fn_printn(ndo, bp, suboptlen, ndo->ndo_snapend))
+                                                       goto trunc;
                                                break;
 
                                        default: