Tighten the NO_MORE_DATA_CHECK macros

We should return if we've already somehow overflowed the apparent length, not
just if we've hit it dead on.

Fixes bug #9932 and probably others.

Change-Id: I2719c3bd38f03e18ea557df962ee4a1beb64c2e8
Reviewed-on: https://code.wireshark.org/review/862
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
This commit is contained in:
Evan Huus 2014-03-29 11:01:06 -04:00
parent 302632f4b3
commit adc46f571c
2 changed files with 2 additions and 2 deletions

View File

@ -1759,7 +1759,7 @@ content_fill_aux(
}
#define NO_MORE_DATA_CHECK(nmdc_len) \
if ((nmdc_len) == (curr_offset - offset)) return(nmdc_len);
if ((nmdc_len) <= (curr_offset - offset)) return(nmdc_len);
/*

View File

@ -247,7 +247,7 @@ extern const char* get_gsm_a_msg_string(int pdu_type, int idx);
}
#define NO_MORE_DATA_CHECK(nmdc_len) \
if ((nmdc_len) == (curr_offset - offset)) return(nmdc_len);
if ((nmdc_len) <= (curr_offset - offset)) return(nmdc_len);
#define SET_ELEM_VARS(SEV_pdu_type, SEV_elem_names_ext, SEV_elem_ett, SEV_elem_funcs) \
switch (SEV_pdu_type) \