]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Check for truncation in strings.
authorGuy Harris <[email protected]>
Thu, 3 Apr 2014 21:49:07 +0000 (14:49 -0700)
committerGuy Harris <[email protected]>
Thu, 3 Apr 2014 21:49:07 +0000 (14:49 -0700)
Found by Coverity.

print-ppp.c

index e42a5398bc1bfee182d58f870e54de4e9844072a..cf1e7d744113d2d9b76af6d96dc7a9f930e1ed69 100644 (file)
@@ -548,7 +548,8 @@ handle_ctrl_proto(netdissect_options *ndo,
                /* RFC 1661 says this is intended to be human readable */
                if (len > 8) {
                        ND_PRINT((ndo, "\n\t  Message\n\t    "));
-                       fn_printn(tptr + 4, len - 4, ndo->ndo_snapend);
+                       if (fn_printn(tptr + 4, len - 4, ndo->ndo_snapend))
+                               goto trunc;
                }
                break;
        case CPCODES_TIME_REM: