summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mongo.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-17 15:00:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-17 15:00:52 +0000
commit0f157e7d6c4be48f213ea022cb2d6d1316c423c8 (patch)
treeff4ad271b50a39e23d5a50a54f4bff37342cdc1c /epan/dissectors/packet-mongo.c
parentAdding debian version 4.2.4-1. (diff)
downloadwireshark-0f157e7d6c4be48f213ea022cb2d6d1316c423c8.tar.xz
wireshark-0f157e7d6c4be48f213ea022cb2d6d1316c423c8.zip
Merging upstream version 4.2.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-mongo.c')
-rw-r--r--epan/dissectors/packet-mongo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/epan/dissectors/packet-mongo.c b/epan/dissectors/packet-mongo.c
index db23a063..346b1324 100644
--- a/epan/dissectors/packet-mongo.c
+++ b/epan/dissectors/packet-mongo.c
@@ -831,7 +831,10 @@ dissect_op_msg_section(tvbuff_t *tvb, packet_info *pinfo, guint offset, proto_tr
switch (e_type) {
case KIND_BODY:
- dissect_bson_document(tvb, pinfo, offset, section_tree, hf_mongo_msg_sections_section_body);
+ section_len = dissect_bson_document(tvb, pinfo, offset, section_tree, hf_mongo_msg_sections_section_body);
+ /* If section_len is bogus (e.g., negative), dissect_bson_document sets
+ * an expert info and can return a different value than read above.
+ */
break;
case KIND_DOCUMENT_SEQUENCE: {
gint32 dsi_length;
@@ -840,6 +843,9 @@ dissect_op_msg_section(tvbuff_t *tvb, packet_info *pinfo, guint offset, proto_tr
proto_tree *documents_tree;
proto_tree_add_item(section_tree, hf_mongo_msg_sections_section_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
+ /* This is redundant with the lengths in the documents, we don't use this
+ * size at all. We could still report an expert info if it's bogus.
+ */
offset += 4;
to_read -= 4;