aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2022-03-18 08:28:29 -0400
committerA Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2022-03-18 21:11:09 +0000
commit37a0054551fafffcac5435c3f683b45176388cd4 (patch)
treec6ef809cc3e48d8945bd8c08a024c81d227c8387
parent096bc367b6ebf932850a5e11176e2b19e66ac65e (diff)
http: Pass data relative to the original offset to follow tap
dissect_http_message might get called with a nonzero offset into the tvb if there are multiple messages/segments in a frame. Only send data starting from that offset to the follow tap, instead of starting at tvb offset 0. Fix #18006
-rw-r--r--epan/dissectors/packet-http.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 29d2cf7cc2..5a96631649 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -1052,7 +1052,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
const guchar *line, *firstline;
gint next_offset;
const guchar *linep, *lineend;
- int orig_offset;
+ int orig_offset = offset;
int first_linelen, linelen;
gboolean is_request_or_reply, is_tls = FALSE;
gboolean saw_req_resp_or_header;
@@ -1120,7 +1120,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
ti = proto_tree_add_item(tree, proto, tvb, offset, -1, ENC_NA);
http_tree = proto_item_add_subtree(ti, ett_http);
- call_data_dissector(tvb, pinfo, http_tree);
+ call_data_dissector(tvb_new_subset_remaining(tvb, orig_offset), pinfo, http_tree);
}
return -1;
}
@@ -1243,8 +1243,6 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
stat_info->location_target = NULL;
stat_info->location_base_uri = NULL;
- orig_offset = offset;
-
/*
* Process the packet data, a line at a time.
*/
@@ -1537,7 +1535,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* Give the follw tap what we've currently dissected */
if(have_tap_listener(http_follow_tap)) {
- tap_queue_packet(http_follow_tap, pinfo, tvb_new_subset_length(tvb, 0, offset));
+ tap_queue_packet(http_follow_tap, pinfo, tvb_new_subset_length(tvb, orig_offset, offset-orig_offset));
}
reported_datalen = tvb_reported_length_remaining(tvb, offset);