Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/webservices/tests/url.c | 4 ++++ dlls/webservices/url.c | 16 +++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/dlls/webservices/tests/url.c b/dlls/webservices/tests/url.c index 718f072f19c..4343dc6a3dd 100644 --- a/dlls/webservices/tests/url.c +++ b/dlls/webservices/tests/url.c @@ -50,6 +50,8 @@ static void test_WsDecodeUrl(void) static const WCHAR url25[] = L"http://host?query%202"; static const WCHAR url26[] = L"http://host#frag%202"; static const WCHAR url27[] = L"http://host/%c3%ab/"; + static const WCHAR url28[] = L"net.tcp://[::1]"; + static const WCHAR url29[] = L"net.tcp://[::1]:1111"; static const struct { const WCHAR *str; @@ -97,6 +99,8 @@ static void test_WsDecodeUrl(void) { url25, S_OK, WS_URL_HTTP_SCHEME_TYPE, url25 + 7, 4, 80, NULL, 0, NULL, 0, L"query 2", 7 }, { url26, S_OK, WS_URL_HTTP_SCHEME_TYPE, url26 + 7, 4, 80, NULL, 0, NULL, 0, NULL, 0, L"frag 2", 6 }, { url27, S_OK, WS_URL_HTTP_SCHEME_TYPE, url27 + 7, 4, 80, NULL, 0, L"/\x00eb/", 3 }, + { url28, S_OK, WS_URL_NETTCP_SCHEME_TYPE, url28 + 10, 5, 808, NULL, 0, NULL, 0 }, + { url29, S_OK, WS_URL_NETTCP_SCHEME_TYPE, url29 + 10, 5, 1111, url29 + 16, 4, NULL, 0 }, }; WS_HEAP *heap; WS_STRING str; diff --git a/dlls/webservices/url.c b/dlls/webservices/url.c index f2fbda83c1f..b44ee468e27 100644 --- a/dlls/webservices/url.c +++ b/dlls/webservices/url.c @@ -169,16 +169,14 @@ static WCHAR *url_decode( WCHAR *str, ULONG len, WS_HEAP *heap, ULONG *ret_len ) /************************************************************************** * WsDecodeUrl [webservices.@] */ -HRESULT WINAPI WsDecodeUrl( const WS_STRING *str, ULONG flags, WS_HEAP *heap, WS_URL **ret, - WS_ERROR *error ) +HRESULT WINAPI WsDecodeUrl( const WS_STRING *str, ULONG flags, WS_HEAP *heap, WS_URL **ret, WS_ERROR *error ) { HRESULT hr = WS_E_QUOTA_EXCEEDED; WCHAR *p, *q, *decoded = NULL; WS_HTTP_URL *url = NULL; ULONG len, len_decoded, port = 0;
- TRACE( "%s %08x %p %p %p\n", str ? debugstr_wn(str->chars, str->length) : "null", flags, - heap, ret, error ); + TRACE( "%s %08x %p %p %p\n", str ? debugstr_wn(str->chars, str->length) : "null", flags, heap, ret, error ); if (error) FIXME( "ignoring error parameter\n" );
if (!str || !heap) return E_INVALIDARG; @@ -203,7 +201,15 @@ HRESULT WINAPI WsDecodeUrl( const WS_STRING *str, ULONG flags, WS_HEAP *heap, WS if (!--len || *++q != '/') goto done;
p = ++q; len--; - while (len && *q != '/' && *q != ':' && *q != '?' && *q != '#') { q++; len--; }; + if (*q == '[') + { + while (len && *q != ']') { q++; len--; }; + if (*q++ != ']') goto done; + } + else + { + while (len && *q != '/' && *q != ':' && *q != '?' && *q != '#') { q++; len--; }; + } if (q == p) goto done; url->host.length = q - p; url->host.chars = p;