proto: Check for empty protocol->fields
In proto_get_first_protocol_field() we must check for an empty protocol->fields because Lua scripts may have protocols without fields and g_ptr_array_index() does not perform bounds checking on the given index. Bug: 13223 Change-Id: Ib2f6286d0799541243450348dcf345a965b2825c Reviewed-on: https://code.wireshark.org/review/20455 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
540b555729
commit
528a3d31ff
|
@ -6066,7 +6066,7 @@ proto_get_first_protocol_field(const int proto_id, void **cookie)
|
|||
{
|
||||
protocol_t *protocol = find_protocol_by_id(proto_id);
|
||||
|
||||
if ((protocol == NULL) || (protocol->fields == NULL))
|
||||
if ((protocol == NULL) || (protocol->fields == NULL) || (protocol->fields->len == 0))
|
||||
return NULL;
|
||||
|
||||
*cookie = GUINT_TO_POINTER(0 + 1);
|
||||
|
|
Loading…
Reference in New Issue