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
4d592ae8
Commit
4d592ae8
authored
Oct 18, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Make more strict restriction for URL scheme and fix error handling in ParseURLW.
parent
e57b8526
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
27 deletions
+15
-27
url.c
dlls/shlwapi/tests/url.c
+1
-1
url.c
dlls/shlwapi/url.c
+14
-26
No files found.
dlls/shlwapi/tests/url.c
View file @
4d592ae8
...
...
@@ -131,7 +131,7 @@ static const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = {
{
"res:///c:
\\
tests
\\
foo bar"
,
0
,
S_OK
,
"res:///c:
\\
tests
\\
foo bar"
,
TRUE
},
{
"res:///c:
\\
tests
\\
foo bar"
,
URL_DONT_SIMPLIFY
,
S_OK
,
"res:///c:
\\
tests
\\
foo bar"
,
TRUE
},
{
"A"
,
0
,
S_OK
,
"A"
,
FALSE
},
{
"/uri-res/N2R?urn:sha1:B3K"
,
URL_DONT_ESCAPE_EXTRA_INFO
|
URL_WININET_COMPATIBILITY
/*0x82000000*/
,
S_OK
,
"/uri-res/N2R?urn:sha1:B3K"
,
TRU
E
}
/*LimeWire online installer calls this*/
,
{
"/uri-res/N2R?urn:sha1:B3K"
,
URL_DONT_ESCAPE_EXTRA_INFO
|
URL_WININET_COMPATIBILITY
/*0x82000000*/
,
S_OK
,
"/uri-res/N2R?urn:sha1:B3K"
,
FALS
E
}
/*LimeWire online installer calls this*/
,
{
"http:www.winehq.org/dir/../index.html"
,
0
,
S_OK
,
"http:www.winehq.org/index.html"
},
};
...
...
dlls/shlwapi/url.c
View file @
4d592ae8
...
...
@@ -180,38 +180,26 @@ HRESULT WINAPI ParseURLA(LPCSTR x, PARSEDURLA *y)
*/
HRESULT
WINAPI
ParseURLW
(
LPCWSTR
x
,
PARSEDURLW
*
y
)
{
DWORD
cnt
;
const
WCHAR
*
ptr
=
x
;
y
->
nScheme
=
URL_SCHEME_INVALID
;
if
(
y
->
cbSize
!=
sizeof
(
*
y
))
return
E_INVALIDARG
;
/* FIXME: leading white space generates error of 0x80041001 which
* is undefined
*/
if
(
*
x
<=
' '
)
return
0x80041001
;
cnt
=
0
;
y
->
cchProtocol
=
0
;
y
->
pszProtocol
=
x
;
while
(
*
x
)
{
if
(
*
x
==
':'
)
{
y
->
cchProtocol
=
cnt
;
cnt
=
-
1
;
y
->
pszSuffix
=
x
+
1
;
break
;
}
x
++
;
cnt
++
;
}
TRACE
(
"%s %p
\n
"
,
debugstr_w
(
x
),
y
);
if
(
y
->
cbSize
!=
sizeof
(
*
y
))
return
E_INVALIDARG
;
while
(
*
ptr
&&
(
isalnumW
(
*
ptr
)
||
*
ptr
==
'-'
))
ptr
++
;
/* check for no scheme in string start */
/* (apparently schemes *must* be larger than a single character) */
if
((
*
x
==
'\0'
)
||
(
y
->
cchProtocol
<=
1
))
{
if
(
*
ptr
!=
':'
||
ptr
<=
x
+
1
)
{
y
->
pszProtocol
=
NULL
;
return
0x80041001
;
}
/* found scheme, set length of remainder */
y
->
cchSuffix
=
lstrlenW
(
y
->
pszSuffix
);
y
->
nScheme
=
get_scheme_code
(
y
->
pszProtocol
,
y
->
cchProtocol
);
y
->
pszProtocol
=
x
;
y
->
cchProtocol
=
ptr
-
x
;
y
->
pszSuffix
=
ptr
+
1
;
y
->
cchSuffix
=
strlenW
(
y
->
pszSuffix
);
y
->
nScheme
=
get_scheme_code
(
x
,
ptr
-
x
);
return
S_OK
;
}
...
...
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