Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e57b8526
Commit
e57b8526
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 ParseURLA.
parent
a34ed0f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
27 deletions
+16
-27
url.c
dlls/shlwapi/url.c
+16
-27
No files found.
dlls/shlwapi/url.c
View file @
e57b8526
...
...
@@ -145,40 +145,29 @@ static DWORD get_scheme_code(LPCWSTR scheme, DWORD scheme_len)
HRESULT
WINAPI
ParseURLA
(
LPCSTR
x
,
PARSEDURLA
*
y
)
{
WCHAR
scheme
[
INTERNET_MAX_SCHEME_LENGTH
];
DWORD
cnt
,
len
;
const
char
*
ptr
=
x
;
int
len
;
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_a
(
x
),
y
);
/* check for no scheme in string start */
/* (apparently schemes *must* be larger than a single character) */
if
((
*
x
==
'\0'
)
||
(
y
->
cchProtocol
<=
1
))
{
if
(
y
->
cbSize
!=
sizeof
(
*
y
))
return
E_INVALIDARG
;
while
(
*
ptr
&&
(
isalnum
(
*
ptr
)
||
*
ptr
==
'-'
))
ptr
++
;
if
(
*
ptr
!=
':'
||
ptr
<=
x
+
1
)
{
y
->
pszProtocol
=
NULL
;
return
0x80041001
;
}
/* found scheme, set length of remainder */
y
->
cchSuffix
=
lstrlenA
(
y
->
pszSuffix
);
y
->
pszProtocol
=
x
;
y
->
cchProtocol
=
ptr
-
x
;
y
->
pszSuffix
=
ptr
+
1
;
y
->
cchSuffix
=
strlen
(
y
->
pszSuffix
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
y
->
pszProtocol
,
y
->
cchProtocol
,
scheme
,
sizeof
(
scheme
)
/
sizeof
(
WCHAR
));
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
x
,
ptr
-
x
,
scheme
,
sizeof
(
scheme
)
/
sizeof
(
WCHAR
));
y
->
nScheme
=
get_scheme_code
(
scheme
,
len
);
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