aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2017-03-09 08:34:54 +0100
committerAnders Broman <a.broman58@gmail.com>2017-03-09 08:58:27 +0000
commit528a3d31ff1861d5445ee649752876e8bed82270 (patch)
tree838357a88db5df3d955deb85ee435a8b1f470d85 /epan/proto.c
parent540b5557291ad0960ce566adc3f24100aac946de (diff)
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>
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/proto.c b/epan/proto.c
index f9b211caa5..45a3ad6827 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -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);