Module: wine Branch: master Commit: 8fcf7013bccbcdf6f26781f1e319b7591efa2ea7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8fcf7013bccbcdf6f26781f1e3...
Author: Jacek Caban jacek@codeweavers.com Date: Tue Jul 26 13:57:50 2011 +0200
urlmon: Store URI host len in parse_ipv4address before further parsing.
---
dlls/urlmon/tests/uri.c | 25 +++++++++++++++++++++++++ dlls/urlmon/uri.c | 6 +++--- 2 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index a11b9d0..2fe67c2 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -997,6 +997,31 @@ static const uri_properties uri_tests[] = { {URLZONE_INVALID,E_NOTIMPL,FALSE} } }, + { "http://127.0.0.1:8000", 0, S_OK, FALSE, + { + {"http://127.0.0.1:8000/%22,S_OK%7D, + {"127.0.0.1:8000",S_OK}, + {"http://127.0.0.1:8000/%22,S_OK%7D, + {"",S_FALSE}, + {"",S_FALSE}, + {"",S_FALSE}, + {"127.0.0.1",S_OK}, + {"",S_FALSE}, + {"/",S_OK}, + {"/",S_OK}, + {"",S_FALSE}, + {"http://127.0.0.1:8000%22,S_OK%7D, + {"http",S_OK}, + {"",S_FALSE}, + {"",S_FALSE} + }, + { + {Uri_HOST_IPV4,S_OK,FALSE}, + {8000,S_OK,FALSE}, + {URL_SCHEME_HTTP,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } + }, /* Make sure it normalizes partial IPv4 addresses correctly. */ { "http://127.0/", 0, S_OK, FALSE, { diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 9928070..5dfa8b8 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -1493,6 +1493,9 @@ static BOOL parse_ipv4address(const WCHAR **ptr, parse_data *data, DWORD flags) data->has_implicit_ip = TRUE; }
+ data->host_len = *ptr - data->host; + data->host_type = Uri_HOST_IPV4; + /* Check if what we found is the only part of the host name (if it isn't * we don't have an IPv4 address). */ @@ -1511,9 +1514,6 @@ static BOOL parse_ipv4address(const WCHAR **ptr, parse_data *data, DWORD flags) return FALSE; }
- data->host_len = *ptr - data->host; - data->host_type = Uri_HOST_IPV4; - TRACE("(%p %p %x): IPv4 address found. host=%s host_len=%d host_type=%d\n", ptr, data, flags, debugstr_wn(data->host, data->host_len), data->host_len, data->host_type);