epan: Fix our FT_UINT_BYTES and FT_UINT_STRING checks.
FT_UINT_BYTES and FT_UINT_STRING lengths are always at least the width
of the count bytes. Fix for 1136ce9610
/ #17891.
This commit is contained in:
parent
e93001a8dd
commit
a8c8ee6908
|
@ -6150,7 +6150,7 @@ get_full_length(header_field_info *hfinfo, tvbuff_t *tvb, const gint start,
|
|||
case FT_UINT_BYTES:
|
||||
n = get_uint_value(NULL, tvb, start, length, encoding);
|
||||
item_length += n;
|
||||
if ((int)item_length < 0) {
|
||||
if ((int)item_length < length) {
|
||||
THROW(ReportedBoundsError);
|
||||
}
|
||||
break;
|
||||
|
@ -6232,7 +6232,7 @@ get_full_length(header_field_info *hfinfo, tvbuff_t *tvb, const gint start,
|
|||
case FT_UINT_STRING:
|
||||
n = get_uint_value(NULL, tvb, start, length, encoding & ~ENC_CHARENCODING_MASK);
|
||||
item_length += n;
|
||||
if ((int)item_length < 0) {
|
||||
if ((int)item_length < length) {
|
||||
THROW(ReportedBoundsError);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue