Juniper: Fix an undefined behavior at runtime

The error was:
print-juniper.c:1407:21: runtime error: index 8 out of bounds for
type 'uint8_t [8]'

Thix fixes GitHub issue #783.
This commit is contained in:
Francois-Xavier Le Bail 2019-07-25 12:28:14 +02:00
parent 7b575ba803
commit 8c7221d39b

View File

@ -1399,6 +1399,11 @@ juniper_parse_header(netdissect_options *ndo,
lp->s,
l2info->cookie_len);
if (l2info->cookie_len > 8) {
nd_print_invalid(ndo);
return 0;
}
if (l2info->cookie_len > 0) {
ND_TCHECK_LEN(p, l2info->cookie_len);
if (ndo->ndo_eflag)