aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorD. Ulis <daulis0@gmail.com>2015-12-10 23:19:46 -0500
committerMichael Mann <mmann78@netscape.net>2015-12-11 12:41:49 +0000
commit1a40ce95c546468cf4ae9d1b0980c613a6d1fe3b (patch)
treef1640b18bc78d9c7a14b13fa92bf39a48e5536eb /epan
parent3120d1f8012377820dbc011713377ff9daab5f5c (diff)
ENIP: Add sanity check when connection info not available
If the connection info is not available, ensure that enough connected data is available to meet the minimum explicit message size. Change-Id: I6c8bf54dda4adbf23749d2a2c8c19f4ea2bc5222 Reviewed-on: https://code.wireshark.org/review/12520 Reviewed-by: Anders Broman <a.broman58@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-enip.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c
index 8ed80271ec..297aba6ee7 100644
--- a/epan/dissectors/packet-enip.c
+++ b/epan/dissectors/packet-enip.c
@@ -1911,6 +1911,13 @@ dissect_cpf(enip_request_key_t *request_key, int command, tvbuff_t *tvb,
/* Call dissector for interface */
next_tvb = tvb_new_subset_length (tvb, offset+8, item_length-2);
+ /* If we don't have the connection info, we can't be sure of the data format, so
+ ensure that the data can at least meet the minimum explicit message size. */
+ if ((conn_info == NULL) && tvb_reported_length(next_tvb) < 2)
+ {
+ break;
+ }
+
if ((conn_info == NULL) || (conn_info->ClassID == CI_CLS_MR))
{
p_add_proto_data(wmem_file_scope(), pinfo, proto_enip, ENIP_REQUEST_INFO, request_info);