Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2ca477c8
Commit
2ca477c8
authored
Mar 16, 2010
by
Maciej Borsz
Committed by
Alexandre Julliard
Mar 17, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Fix invalid behaviour of WinHttpCrackUrl.
parent
e3857482
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
url.c
dlls/winhttp/tests/url.c
+19
-0
url.c
dlls/winhttp/url.c
+1
-1
No files found.
dlls/winhttp/tests/url.c
View file @
2ca477c8
...
...
@@ -65,6 +65,8 @@ static const WCHAR url10[] =
static
const
WCHAR
url11
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
's'
,
':'
,
'/'
,
'/'
,
'u'
,
's'
,
'e'
,
'r'
,
'n'
,
'a'
,
'm'
,
'e'
,
':'
,
'p'
,
'a'
,
's'
,
's'
,
'w'
,
'o'
,
'r'
,
'd'
,
'@'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
':'
,
'4'
,
'4'
,
'3'
,
'/'
,
's'
,
'i'
,
't'
,
'e'
,
'/'
,
'a'
,
'b'
,
'o'
,
'u'
,
't'
,
'?'
,
'q'
,
'u'
,
'e'
,
'r'
,
'y'
,
0
};
static
const
WCHAR
url12
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'e'
,
'x'
,
'a'
,
'm'
,
'p'
,
'l'
,
'e'
,
'.'
,
'n'
,
'e'
,
't'
,
'/'
,
'p'
,
'a'
,
't'
,
'h'
,
'?'
,
'v'
,
'a'
,
'r'
,
'1'
,
'='
,
'e'
,
'x'
,
'a'
,
'm'
,
'p'
,
'l'
,
'e'
,
'@'
,
'e'
,
'x'
,
'a'
,
'm'
,
'p'
,
'l'
,
'e'
,
'.'
,
'c'
,
'o'
,
'm'
,
'&'
,
'v'
,
'a'
,
'r'
,
'2'
,
'='
,
'x'
,
'&'
,
'v'
,
'a'
,
'r'
,
'3'
,
'='
,
'y'
,
0
};
...
...
@@ -565,6 +567,23 @@ static void WinHttpCrackUrl_test( void )
error
=
GetLastError
();
ok
(
!
ret
,
"WinHttpCrackUrl succeeded
\n
"
);
ok
(
error
==
ERROR_WINHTTP_UNRECOGNIZED_SCHEME
,
"got %u, expected ERROR_WINHTTP_UNRECOGNIZED_SCHEME
\n
"
,
error
);
reset_url_components
(
&
uc
);
ret
=
WinHttpCrackUrl
(
url12
,
0
,
0
,
&
uc
);
ok
(
ret
,
"WinHttpCrackUrl failed
\n
"
);
ok
(
uc
.
nScheme
==
INTERNET_SCHEME_HTTP
,
"unexpected scheme
\n
"
);
ok
(
uc
.
lpszScheme
==
url12
,
"unexpected scheme
\n
"
);
ok
(
uc
.
dwSchemeLength
==
4
,
"unexpected scheme length
\n
"
);
ok
(
uc
.
lpszUserName
==
NULL
,
"unexpected username
\n
"
);
ok
(
uc
.
lpszPassword
==
NULL
,
"unexpected password
\n
"
);
ok
(
uc
.
lpszHostName
==
url12
+
7
,
"unexpected hostname
\n
"
);
ok
(
uc
.
dwHostNameLength
==
11
,
"unexpected hostname length
\n
"
);
ok
(
uc
.
nPort
==
80
,
"unexpected port: %u
\n
"
,
uc
.
nPort
);
ok
(
uc
.
lpszUrlPath
==
url12
+
18
,
"unexpected path
\n
"
);
ok
(
uc
.
dwUrlPathLength
==
5
,
"unexpected path length
\n
"
);
ok
(
uc
.
lpszExtraInfo
==
url12
+
23
,
"unexpected extra info
\n
"
);
ok
(
uc
.
dwExtraInfoLength
==
39
,
"unexpected extra info length
\n
"
);
}
START_TEST
(
url
)
...
...
dlls/winhttp/url.c
View file @
2ca477c8
...
...
@@ -133,7 +133,7 @@ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONEN
p
+=
2
;
if
(
!
p
[
0
])
goto
exit
;
if
((
q
=
memchrW
(
p
,
'@'
,
len
-
(
p
-
url
)
)))
if
((
q
=
memchrW
(
p
,
'@'
,
len
-
(
p
-
url
)
))
&&
!
(
memchrW
(
p
,
'/'
,
q
-
p
))
)
{
if
((
r
=
memchrW
(
p
,
':'
,
q
-
p
)))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment