diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2018-06-13 12:12:38 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2018-06-13 12:32:44 +0000 |
commit | e281ca6f83560a24ac1d490dcca9fe49b03bbdcd (patch) | |
tree | 8db2d5383a627717fdf72c832c41cff660e245bd /epan/dissectors/packet-http2.c | |
parent | 94bf85ad26b6c244e49067921dbadcf2db4fd9cb (diff) |
HTTP2: prevent a segmentation fault if HTTP2 dissector was not called on first pass
With HTTP2 heuristics to identify the conversation, a packet can be
skipped on first pass and then decoded as HTTP2 on subsequent ones.
Check that header data is available before attempting header
decompression.
Bug: 14869
Change-Id: I8ef7669ca33835b509acb38d797e33d6167a1bd1
Reviewed-on: https://code.wireshark.org/review/28257
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-http2.c')
-rw-r--r-- | epan/dissectors/packet-http2.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/dissectors/packet-http2.c b/epan/dissectors/packet-http2.c index fe3e7c3880..055db5535c 100644 --- a/epan/dissectors/packet-http2.c +++ b/epan/dissectors/packet-http2.c @@ -1699,7 +1699,7 @@ inflate_http2_header_block(tvbuff_t *tvb, packet_info *pinfo, guint offset, wmem_list_append(header_stream_info->stream_header_list, headers); } - } else { + } else if (header_data->current) { headers = (wmem_array_t*)wmem_list_frame_data(header_data->current); header_data->current = wmem_list_frame_next(header_data->current); @@ -1707,6 +1707,8 @@ inflate_http2_header_block(tvbuff_t *tvb, packet_info *pinfo, guint offset, if(!header_data->current) { header_data->current = wmem_list_head(header_list); } + } else { + return; } if(wmem_array_get_count(headers) == 0) { |