From d447467eb5a7b609d1594d9efacbd91e4ffad50d Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Sun, 4 Feb 2018 17:31:23 +0100 Subject: [PATCH] MQ: use real string length when calling strip_trailing_blanks() Bug: 14390 Change-Id: I5acfc651237da55c3ee907f21d89a3add6edeeef Reviewed-on: https://code.wireshark.org/review/25596 Petri-Dish: Pascal Quantin Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin --- epan/dissectors/packet-mq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c index e368c7de50..4b4112e4b4 100644 --- a/epan/dissectors/packet-mq.c +++ b/epan/dissectors/packet-mq.c @@ -2491,13 +2491,13 @@ static void dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) sApplicationName = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 48, 28, iEnc); sApplicationName = format_text_chr(wmem_packet_scope(), sApplicationName, strlen(sApplicationName), '.'); - if (strip_trailing_blanks((guint8 *)sApplicationName, 28) > 0) + if (strip_trailing_blanks((guint8 *)sApplicationName, (guint32)strlen(sApplicationName)) > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, " App=%s", sApplicationName); } sQMgr = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 48, iEnc); sQMgr = format_text_chr(wmem_packet_scope(), sQMgr, strlen(sQMgr), '.'); - if (strip_trailing_blanks((guint8 *)sQMgr, 48) > 0) + if (strip_trailing_blanks((guint8 *)sQMgr, (guint32)strlen(sQMgr)) > 0) { col_append_fstr(pinfo->cinfo, COL_INFO, " QM=%s", sQMgr); }