diff options
author | Baptiste Jonglez <baptiste.jonglez@ens-lyon.org> | 2014-06-20 09:46:00 +0900 |
---|---|---|
committer | Baptiste Jonglez <baptiste.jonglez@ens-lyon.org> | 2014-06-20 09:46:00 +0900 |
commit | 8bdce111090f6f880b1829e34d2268f7240b6c19 (patch) | |
tree | 0bd90d3ec630b6b851197face1158c3982c48ae4 | |
parent | 316dced5e89990e9b37e0ddab466dfbd8ae6dba1 (diff) | |
download | tcpdump-8bdce111090f6f880b1829e34d2268f7240b6c19.tar.gz |
Babel: parse sub-TLVs even when they are larger than expected.
We can imagine appending additional data to sub-TLVs in the future: be
more forgiving when parsing them.
-rw-r--r-- | print-babel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/print-babel.c b/print-babel.c index 51de3114..bb3401be 100644 --- a/print-babel.c +++ b/print-babel.c @@ -309,12 +309,12 @@ subtlvs_print(netdissect_options *ndo, case MESSAGE_SUB_TIMESTAMP: ND_PRINT((ndo, " sub-timestamp")); if(tlv_type == MESSAGE_HELLO) { - if(sublen != 4) + if(sublen < 4) goto corrupt; t1 = EXTRACT_32BITS(cp); ND_PRINT((ndo, " %s", format_timestamp(t1))); } else if(tlv_type == MESSAGE_IHU) { - if(sublen != 8) + if(sublen < 8) goto corrupt; t1 = EXTRACT_32BITS(cp); ND_PRINT((ndo, " %s", format_timestamp(t1))); |