diff options
author | Guy Harris <gharris@sonic.net> | 2020-05-27 02:18:38 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2020-05-27 02:18:38 -0700 |
commit | 11e454d0ba87183f359a63ee0119ae27f50496af (patch) | |
tree | bb468e35ceeaae4c79c96a7b167e8cecef0cc389 /print-ospf6.c | |
parent | 8db6f03dcda23b26217af0733e698bdb214dc156 (diff) | |
download | tcpdump-11e454d0ba87183f359a63ee0119ae27f50496af.tar.gz |
ospf6: note some places where subtraction won't underflow.
Diffstat (limited to 'print-ospf6.c')
-rw-r--r-- | print-ospf6.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/print-ospf6.c b/print-ospf6.c index c94a7793..5c0b090d 100644 --- a/print-ospf6.c +++ b/print-ospf6.c @@ -574,6 +574,11 @@ ospf6_print_lsa(netdissect_options *ndo, bytelen = ospf6_print_lsaprefix(ndo, tptr, lsa_length); if (bytelen < 0) goto trunc; + /* + * ospf6_print_lsaprefix() will return -1 if + * the length is too high, so this will not + * underflow. + */ lsa_length -= bytelen; tptr += bytelen; } @@ -596,6 +601,11 @@ ospf6_print_lsa(netdissect_options *ndo, bytelen = ospf6_print_lsaprefix(ndo, tptr, lsa_length); if (bytelen < 0) goto trunc; + /* + * ospf6_print_lsaprefix() will return -1 if + * the length is too high, so this will not + * underflow. + */ lsa_length -= bytelen; tptr += bytelen; @@ -657,6 +667,11 @@ ospf6_print_lsa(netdissect_options *ndo, if (bytelen < 0) goto trunc; prefixes--; + /* + * ospf6_print_lsaprefix() will return -1 if + * the length is too high, so this will not + * underflow. + */ lsa_length -= bytelen; tptr += bytelen; } @@ -685,6 +700,11 @@ ospf6_print_lsa(netdissect_options *ndo, if (bytelen < 0) goto trunc; prefixes--; + /* + * ospf6_print_lsaprefix() will return -1 if + * the length is too high, so this will not + * underflow. + */ lsa_length -= bytelen; tptr += bytelen; } |