You cannot just make the "len" field of a GByteArray larger, if there's
no data to back that length; you can only make it smaller. svn path=/trunk/; revision=37236
This commit is contained in:
parent
fc65604b7e
commit
aa392a40fe
|
@ -4096,7 +4096,12 @@ proto_item_set_len(proto_item *pi, const gint length)
|
|||
DISSECTOR_ASSERT(length >= 0);
|
||||
fi->length = length;
|
||||
|
||||
if (fi->value.ftype->ftype == FT_BYTES)
|
||||
/*
|
||||
* You cannot just make the "len" field of a GByteArray
|
||||
* larger, if there's no data to back that length;
|
||||
* you can only make it smaller.
|
||||
*/
|
||||
if (fi->value.ftype->ftype == FT_BYTES && length <= fi->length)
|
||||
fi->value.value.bytes->len = length;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue