aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-01-10 10:16:37 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2015-01-10 16:44:40 +0000
commitb760da956d7c0de89c1993f475f85a93186a0e95 (patch)
tree23338fa1b0ba27df195e48804ef82e02d3a9fd25 /epan
parent7600ddb88e758e19ddae0863c5bb8cc68cd602cb (diff)
MQ: ensure that at least 4 bytes were captured before doing heuristic checks
Otherwise it could trigger an exception Change-Id: I280e3c5d9e5554e4be49035c03e0170ae4495e6e Reviewed-on: https://code.wireshark.org/review/6463 Reviewed-by: Robert Grange <robionekenobi@bluewin.ch> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-mq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c
index 183cbb2971..e682992d99 100644
--- a/epan/dissectors/packet-mq.c
+++ b/epan/dissectors/packet-mq.c
@@ -4048,7 +4048,7 @@ static void dissect_mq_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static gboolean dissect_mq_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint iProto, void *data)
{
- if (tvb_reported_length(tvb) >= 28)
+ if ((tvb_captured_length(tvb) >= 4) && (tvb_reported_length(tvb) >= 28))
{
guint32 mq_strucID = tvb_get_ntohl(tvb, 0);
if ( (mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx || (mq_strucID & MQ_MASK_TSHx) == MQ_STRUCTID_TSHx_EBCDIC )