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 27c10ed72e),
so pinfo->can_desegment needs to be restored before it is decremented
a second time.  Fixes #14217.
This commit is contained in:
John Thacker 2021-08-25 17:24:31 -04:00
parent 4b7bfe35c5
commit f997f28898
1 changed files with 5 additions and 0 deletions

View File

@ -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)");