diff options
author | Gerald Combs <gerald@wireshark.org> | 2017-10-04 15:58:31 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-10-05 04:16:14 +0000 |
commit | 7219f6467feb8ce767689aa456fe8ff2f711e22a (patch) | |
tree | 2802d7edabffe97616e47d835342a2a1517ffb02 | |
parent | 8804ddbe2a35a9e8bc1340912e73479cb2f31390 (diff) |
HTTP: Add http.file_data based on the captured length.
Switch the file_data handling to use the captured length. In a test
capture here this lets us call the GIF dissector in a truncated packet.
Fixup a variable type and some whitespace.
Change-Id: I21b64519ad84f730e1412115035125c2bf1f361c
Reviewed-on: https://code.wireshark.org/review/23838
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-http.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index 204c5bc439..3fa12a6c7c 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -339,7 +339,7 @@ static void process_header(tvbuff_t *tvb, int offset, int next_offset, const guchar *line, int linelen, int colon_offset, packet_info *pinfo, proto_tree *tree, headers_t *eh_ptr, http_conv_t *conv_data, - int http_type); + http_type_t http_type); static gint find_header_hf_value(tvbuff_t *tvb, int offset, guint header_len); static gboolean check_auth_ntlmssp(proto_item *hdr_item, tvbuff_t *tvb, packet_info *pinfo, gchar *value); @@ -1550,9 +1550,9 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo, if(have_tap_listener(http_follow_tap)) { tap_queue_packet(http_follow_tap, pinfo, next_tvb); } - file_data = tvb_get_string_enc(wmem_packet_scope(), next_tvb, 0, tvb_reported_length(next_tvb), ENC_ASCII); + file_data = tvb_get_string_enc(wmem_packet_scope(), next_tvb, 0, tvb_captured_length(next_tvb), ENC_ASCII); proto_tree_add_string_format_value(http_tree, hf_http_file_data, - next_tvb, 0, tvb_reported_length(next_tvb), file_data, "%u bytes", tvb_reported_length(next_tvb)); + next_tvb, 0, tvb_captured_length(next_tvb), file_data, "%u bytes", tvb_captured_length(next_tvb)); /* * Do subdissector checks. @@ -2626,7 +2626,7 @@ static void process_header(tvbuff_t *tvb, int offset, int next_offset, const guchar *line, int linelen, int colon_offset, packet_info *pinfo, proto_tree *tree, headers_t *eh_ptr, - http_conv_t *conv_data, int http_type) + http_conv_t *conv_data, http_type_t http_type) { int len; int line_end_offset; @@ -3059,7 +3059,7 @@ check_auth_citrixbasic(proto_item *hdr_item, tvbuff_t *tvb, gchar *value, int of hf_http_citrix, tvb, 0, 0, 1); PROTO_ITEM_SET_HIDDEN(hidden_item); - if(strncmp(value, "username=\"", 10) == 0) { + if(strncmp(value, "username=\"", 10) == 0) { value += 10; offset += 10; ch_ptr = strchr(value, '"'); @@ -3074,7 +3074,7 @@ check_auth_citrixbasic(proto_item *hdr_item, tvbuff_t *tvb, gchar *value, int of offset += data_len; } } - if(strncmp(value, "; domain=\"", 10) == 0) { + if(strncmp(value, "; domain=\"", 10) == 0) { value += 10; offset += 10; ch_ptr = strchr(value, '"'); @@ -3089,7 +3089,7 @@ check_auth_citrixbasic(proto_item *hdr_item, tvbuff_t *tvb, gchar *value, int of offset += data_len; } } - if(strncmp(value, "; password=\"", 12) == 0) { + if(strncmp(value, "; password=\"", 12) == 0) { value += 12; offset += 12; ch_ptr = strchr(value, '"'); @@ -3104,7 +3104,7 @@ check_auth_citrixbasic(proto_item *hdr_item, tvbuff_t *tvb, gchar *value, int of offset += data_len; } } - if(strncmp(value, "; AGESessionId=\"", 16) == 0) { + if(strncmp(value, "; AGESessionId=\"", 16) == 0) { value += 16; offset += 16; ch_ptr = strchr(value, '"'); |