diff options
author | Evan Huus <eapache@gmail.com> | 2014-05-26 16:33:42 -0400 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-05-26 23:15:49 +0000 |
commit | abed02a8f7e946ba9cf4daaa509e14082209e463 (patch) | |
tree | 7400694d274e5c4239b839389c6889e709e08cdb /epan/dissectors/packet-http.c | |
parent | 5dfdd2b5a5eb74426d090c4250b4c356d6feee6d (diff) | |
download | wireshark-abed02a8f7e946ba9cf4daaa509e14082209e463.tar.gz |
Fix fencepost error in HTTP dissector
Strndup adds +1 for the null-terminator itself, no need to do it in the caller.
This was causing us to go past the end of the buffer when the HTTP header line
didn't have any spaces in it. Caught by Alexis using ASAN.
Bug:10135
Change-Id: Iee1b26da4740b774581ca6ec784ee40f7b920832
Reviewed-on: https://code.wireshark.org/review/1806
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-http.c')
-rw-r--r-- | epan/dissectors/packet-http.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index 048341baa1..b40f72bb7b 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -2206,8 +2206,8 @@ is_http_request_or_reply(const gchar *data, int linelen, http_type_t *type, if (isHttpRequestOrReply && reqresp_dissector) { *reqresp_dissector = basic_request_dissector; - stat_info->request_method = wmem_strndup(wmem_packet_scope(), data, indx+1); - conv_data->request_method = wmem_strndup(wmem_file_scope(), data, indx+1); + stat_info->request_method = wmem_strndup(wmem_packet_scope(), data, indx); + conv_data->request_method = wmem_strndup(wmem_file_scope(), data, indx); } |