aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-01-18 15:35:29 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2015-01-18 14:38:30 +0000
commitb01ef11f875c316d7fa48782429ffd3b07bb6aff (patch)
treec05d81257178df1aaeda7ac003c45ef287419a09
parent266080614535a0360e95be462db54342cecf7d00 (diff)
HTTP: revert a change done in g0ee179c
As indicated in the comment above, the previous code was done on purpose to handle the NUL case Bug: 10866 Change-Id: I66eb9f6fbc9477456310978b420ba30975d81b0a Reviewed-on: https://code.wireshark.org/review/6621 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r--epan/dissectors/packet-http.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 9c7de0e7b9..16bb1dc016 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -2420,7 +2420,9 @@ process_header(tvbuff_t *tvb, int offset, int next_offset,
* has value_len bytes in it.
*/
value_len = line_end_offset - value_offset;
- value = wmem_strndup(wmem_packet_scope(), &line[value_offset - offset], value_len);
+ value = (char *)wmem_alloc(wmem_packet_scope(), value_len+1);
+ memcpy(value, &line[value_offset - offset], value_len);
+ value[value_len] = '\0';
if (hf_index == -1) {
/*