diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2010-09-05 12:16:14 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2010-09-05 12:16:14 +0000 |
commit | 42d0e5b2a851ee329c066384e353f3278cdff0de (patch) | |
tree | 4d8352b6bf3c4c288a5833ebc6a4511b15ada45d | |
parent | 187baa00fae28360f0bde0181f290d3323ca121f (diff) |
Request-Line can contain an empty Request-URI.
I don't want to change get_token_len() to not skip multiple spaces,
because I don't know if other protocols depends on this behaviour.
We should maybe check this...
This fixes bug 5181.
svn path=/trunk/; revision=34063
-rw-r--r-- | epan/dissectors/packet-http.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index be0ac3cd86..700ce758ec 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -1262,13 +1262,15 @@ basic_request_dissector(tvbuff_t *tvb, proto_tree *tree, int offset, return; proto_tree_add_item(tree, hf_http_request_method, tvb, offset, tokenlen, FALSE); + if ((next_token - line) > 2 && next_token[-1] == ' ' && next_token[-2] == ' ') { + /* Two spaces in a now indicates empty URI, so roll back one here */ + next_token--; + } offset += (int) (next_token - line); line = next_token; /* The next token is the URI. */ tokenlen = get_token_len(line, lineend, &next_token); - if (tokenlen == 0) - return; /* Save the request URI for various later uses */ request_uri = (gchar *)tvb_get_ephemeral_string(tvb, offset, tokenlen); @@ -1282,8 +1284,6 @@ basic_request_dissector(tvbuff_t *tvb, proto_tree *tree, int offset, /* Everything to the end of the line is the version. */ tokenlen = (int) (lineend - line); - if (tokenlen == 0) - return; proto_tree_add_item(tree, hf_http_version, tvb, offset, tokenlen, FALSE); } |