From f997f2889828474bd20eaff4265eade918b85f52 Mon Sep 17 00:00:00 2001 From: John Thacker Date: Wed, 25 Aug 2021 17:24:31 -0400 Subject: [PATCH] AMQP: Fix dissection of PDUs split across TCP segments AMQP calls a subdissector table before tcp_dissect_pdus() is used to desegment PDUs (see commit 27c10ed72ea2451bfbb6c0eb50af4280e65a3fcf), so pinfo->can_desegment needs to be restored before it is decremented a second time. Fixes #14217. --- epan/dissectors/packet-amqp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epan/dissectors/packet-amqp.c b/epan/dissectors/packet-amqp.c index ad44d99bb3..82f8d33421 100644 --- a/epan/dissectors/packet-amqp.c +++ b/epan/dissectors/packet-amqp.c @@ -10763,6 +10763,11 @@ dissect_amqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) conversation_add_proto_data(conv, proto_amqp, conn); } check_amqp_version(tvb, conn); + /* Restore can_desegment to whatever TCP set it to before calling the + * subdissector (which will decrement it a second time) in order for + * tcp_dissect_pdus() to work as expected. + */ + pinfo->can_desegment = pinfo->saved_can_desegment; if (!dissector_try_uint_new(version_table, conn->version, tvb, pinfo, tree, FALSE, data)) { col_append_str(pinfo->cinfo, COL_INFO, "AMQP (unknown version)");