]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Telnet: Add a bounds check
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 12 Oct 2016 18:22:09 +0000 (20:22 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 12 Oct 2016 18:22:09 +0000 (20:22 +0200)
print-telnet.c

index f8df48671f873871feb9eb12e80fc91fa9102933..a66403468be78646498ca38e4099111cb500e046 100644 (file)
@@ -437,6 +437,7 @@ telnet_parse(netdissect_options *ndo, const u_char *sp, u_int length, int print)
                /* IAC SB .... IAC SE */
                p = sp;
                while (length > (u_int)(p + 1 - sp)) {
+                       ND_TCHECK2(*p, 2);
                        if (p[0] == IAC && p[1] == SE)
                                break;
                        p++;