]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Make sure we have the entire option before printing it.
authorGuy Harris <[email protected]>
Sat, 14 Jan 2017 10:04:20 +0000 (02:04 -0800)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 18 Jan 2017 08:16:42 +0000 (09:16 +0100)
print-dhcp6.c

index 16f82542013f11d3858a3b006ba44cdc011c120d..78b82ee3ed783ea02de7aeae3913dcb3238ca6b4 100644 (file)
@@ -304,6 +304,7 @@ dhcp6opt_print(netdissect_options *ndo,
                        goto trunc;
                opttype = EXTRACT_16BITS(&dh6o->dh6opt_type);
                ND_PRINT((ndo, " (%s", tok2str(dh6opt_str, "opt_%u", opttype)));
+               ND_TCHECK2(*(cp + sizeof(*dh6o)), optlen);
                switch (opttype) {
                case DH6OPT_CLIENTID:
                case DH6OPT_SERVERID: