aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2019-12-21 15:54:46 +0100
committerPeter Wu <peter@lekensteyn.nl>2019-12-31 17:24:47 +0000
commite9014030fe2dc5926a7e7e8d9f29bf1ebcf6b6bd (patch)
tree3c8f532ae837e51232eaebdd4ac83b3a9de22904
parentf8aa0d5c025d085212aa345a81f56dbace4c54c4 (diff)
HTTP: Fix dissection of data following the HTTP Upgrade response
When a HTTP response includes HTTP headers and a subset of data for the subdissector in the same frame, be sure to skip the HTTP headers for reassembly of the latter data. Otherwise the HTTP headers will be misinterpreted as the subprotocol (for example, WebSocket). Bug: 16274 Change-Id: Ida6f6f2f7d0c463be2d498bfde5e8a9cd11a4b25 Reviewed-on: https://code.wireshark.org/review/35536 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r--epan/dissectors/packet-http.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 69d5131e2d..8a465fa369 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -3598,6 +3598,13 @@ dissect_http_on_stream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
} else {
call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
}
+ /*
+ * If a subdissector requests reassembly, be sure not to
+ * include the preceding HTTP headers.
+ */
+ if (pinfo->desegment_len) {
+ pinfo->desegment_offset += offset;
+ }
break;
}
len = dissect_http_message(tvb, offset, pinfo, tree, conv_data, "HTTP", proto_http, end_of_stream);