From: Francois-Xavier Le Bail Date: Fri, 8 Mar 2019 12:34:39 +0000 (+0100) Subject: Babel: Avoid an unsigned integer underflow X-Git-Tag: tcpdump-4.99-bp~911 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/0aca3bf945b722e55a5accc69920d27d088a1dcc Babel: Avoid an unsigned integer underflow --- diff --git a/print-babel.c b/print-babel.c index fb70a7fc..70310d70 100644 --- a/print-babel.c +++ b/print-babel.c @@ -301,10 +301,11 @@ subtlvs_print(netdissect_options *ndo, break; } sep = " "; - while(sublen--) { + while (sublen) { ND_PRINT("%s%s", sep, tok2str(diversity_str, "%u", EXTRACT_U_1(cp))); cp++; sep = "-"; + sublen--; } if(tlv_type != MESSAGE_UPDATE && tlv_type != MESSAGE_UPDATE_SRC_SPECIFIC)