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
1747b0b1
Commit
1747b0b1
authored
Feb 13, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Do not initialize output params on failure in UrlGetPart().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0df41c35
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
path.c
dlls/kernelbase/path.c
+7
-7
url.c
dlls/shlwapi/tests/url.c
+8
-5
No files found.
dlls/kernelbase/path.c
View file @
1747b0b1
...
...
@@ -4321,8 +4321,6 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
if
(
!
url
||
!
out
||
!
out_len
||
!*
out_len
)
return
E_INVALIDARG
;
*
out
=
'\0'
;
addr
=
wcschr
(
url
,
':'
);
if
(
!
addr
)
scheme
=
URL_SCHEME_UNKNOWN
;
...
...
@@ -4337,6 +4335,7 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
flags
&=
~
URL_PARTFLAG_KEEPSCHEME
;
if
(
!
pl
.
scheme_len
)
{
*
out
=
'\0'
;
*
out_len
=
0
;
return
S_FALSE
;
}
...
...
@@ -4358,18 +4357,19 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
case
URL_SCHEME_SNEWS
:
break
;
default:
*
out_len
=
0
;
return
E_FAIL
;
}
if
(
scheme
==
URL_SCHEME_FILE
&&
(
!
pl
.
hostname_len
||
(
pl
.
hostname_len
==
1
&&
*
(
pl
.
hostname
+
1
)
==
':'
)))
{
*
out
=
'\0'
;
*
out_len
=
0
;
return
S_FALSE
;
}
if
(
!
pl
.
hostname_len
)
{
*
out
=
'\0'
;
*
out_len
=
0
;
return
S_FALSE
;
}
...
...
@@ -4380,6 +4380,7 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
case
URL_PART_USERNAME
:
if
(
!
pl
.
username_len
)
{
*
out
=
'\0'
;
*
out_len
=
0
;
return
S_FALSE
;
}
...
...
@@ -4390,6 +4391,7 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
case
URL_PART_PASSWORD
:
if
(
!
pl
.
password_len
)
{
*
out
=
'\0'
;
*
out_len
=
0
;
return
S_FALSE
;
}
...
...
@@ -4400,6 +4402,7 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
case
URL_PART_PORT
:
if
(
!
pl
.
port_len
)
{
*
out
=
'\0'
;
*
out_len
=
0
;
return
S_FALSE
;
}
...
...
@@ -4411,6 +4414,7 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
flags
&=
~
URL_PARTFLAG_KEEPSCHEME
;
if
(
!
pl
.
query_len
)
{
*
out
=
'\0'
;
*
out_len
=
0
;
return
S_FALSE
;
}
...
...
@@ -4419,17 +4423,13 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
break
;
default:
*
out_len
=
0
;
return
E_INVALIDARG
;
}
if
(
flags
==
URL_PARTFLAG_KEEPSCHEME
&&
scheme
!=
URL_SCHEME_FILE
)
{
if
(
!
pl
.
scheme
||
!
pl
.
scheme_len
)
{
*
out_len
=
0
;
return
E_FAIL
;
}
schaddr
=
pl
.
scheme
;
schsize
=
pl
.
scheme_len
;
if
(
*
out_len
<
schsize
+
size
+
2
)
...
...
dlls/shlwapi/tests/url.c
View file @
1747b0b1
...
...
@@ -845,7 +845,7 @@ static void test_UrlGetPart(void)
ok
(
hr
==
(
tests
[
i
].
hr
==
S_FALSE
?
S_OK
:
tests
[
i
].
hr
),
"Got hr %#x.
\n
"
,
hr
);
}
if
(
hr
==
S_OK
)
if
(
SUCCEEDED
(
hr
)
)
{
ok
(
!
size
,
"Got size %u.
\n
"
,
size
);
ok
(
!
buffer
[
0
],
"Got result %s.
\n
"
,
debugstr_a
(
buffer
));
...
...
@@ -862,9 +862,9 @@ static void test_UrlGetPart(void)
}
else
{
todo_wine
ok
(
size
==
1
,
"Got size %u.
\n
"
,
size
);
ok
(
size
==
1
,
"Got size %u.
\n
"
,
size
);
}
todo_wine
ok
(
!
wcscmp
(
bufferW
,
L"x"
),
"Got result %s.
\n
"
,
debugstr_w
(
bufferW
));
ok
(
!
wcscmp
(
bufferW
,
L"x"
),
"Got result %s.
\n
"
,
debugstr_w
(
bufferW
));
}
size
=
ARRAY_SIZE
(
bufferW
);
...
...
@@ -880,8 +880,11 @@ static void test_UrlGetPart(void)
}
else
{
todo_wine
ok
(
size
==
ARRAY_SIZE
(
bufferW
),
"Got size %u.
\n
"
,
size
);
todo_wine
ok
(
!
wcscmp
(
bufferW
,
L"x"
),
"Got result %s.
\n
"
,
debugstr_w
(
bufferW
));
todo_wine_if
(
strchr
(
url
,
'"'
)
&&
part
==
URL_PART_USERNAME
)
{
ok
(
size
==
ARRAY_SIZE
(
bufferW
),
"Got size %u.
\n
"
,
size
);
ok
(
!
wcscmp
(
bufferW
,
L"x"
),
"Got result %s.
\n
"
,
debugstr_w
(
bufferW
));
}
}
winetest_pop_context
();
...
...
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