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
c6e5e394
Commit
c6e5e394
authored
May 20, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
May 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Validate parameters in MkParseDisplayNameEx.
parent
07325c7d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
misc.c
dlls/urlmon/tests/misc.c
+42
-0
umon.c
dlls/urlmon/umon.c
+3
-0
No files found.
dlls/urlmon/tests/misc.c
View file @
c6e5e394
...
...
@@ -1418,8 +1418,50 @@ static void test_MkParseDisplayNameEx(void)
'2'
,
'0'
,
'D'
,
'0'
,
'4'
,
'F'
,
'E'
,
'0'
,
'-'
,
'3'
,
'A'
,
'E'
,
'A'
,
'-'
,
'1'
,
'0'
,
'6'
,
'9'
,
'-'
,
'A'
,
'2'
,
'D'
,
'8'
,
'-'
,
'0'
,
'8'
,
'0'
,
'0'
,
'2'
,
'B'
,
'3'
,
'0'
,
'3'
,
'0'
,
'9'
,
'D'
,
':'
,
0
};
const
struct
{
LPBC
*
ppbc
;
LPCWSTR
szDisplayName
;
ULONG
*
pchEaten
;
LPMONIKER
*
ppmk
;
}
invalid_parameters
[]
=
{
{
NULL
,
NULL
,
NULL
,
NULL
},
{
NULL
,
NULL
,
NULL
,
&
mon
},
{
NULL
,
NULL
,
&
eaten
,
NULL
},
{
NULL
,
NULL
,
&
eaten
,
&
mon
},
{
NULL
,
wszEmpty
,
NULL
,
NULL
},
{
NULL
,
wszEmpty
,
NULL
,
&
mon
},
{
NULL
,
wszEmpty
,
&
eaten
,
NULL
},
{
NULL
,
wszEmpty
,
&
eaten
,
&
mon
},
{
&
bctx
,
NULL
,
NULL
,
NULL
},
{
&
bctx
,
NULL
,
NULL
,
&
mon
},
{
&
bctx
,
NULL
,
&
eaten
,
NULL
},
{
&
bctx
,
NULL
,
&
eaten
,
&
mon
},
{
&
bctx
,
wszEmpty
,
NULL
,
NULL
},
{
&
bctx
,
wszEmpty
,
NULL
,
&
mon
},
{
&
bctx
,
wszEmpty
,
&
eaten
,
NULL
},
{
&
bctx
,
wszEmpty
,
&
eaten
,
&
mon
},
};
int
i
;
CreateBindCtx
(
0
,
&
bctx
);
for
(
i
=
0
;
i
<
sizeof
(
invalid_parameters
)
/
sizeof
(
invalid_parameters
[
0
]);
i
++
)
{
eaten
=
0xdeadbeef
;
mon
=
(
IMoniker
*
)
0xdeadbeef
;
hres
=
MkParseDisplayNameEx
(
invalid_parameters
[
i
].
ppbc
?
*
invalid_parameters
[
i
].
ppbc
:
NULL
,
invalid_parameters
[
i
].
szDisplayName
,
invalid_parameters
[
i
].
pchEaten
,
invalid_parameters
[
i
].
ppmk
);
ok
(
hres
==
E_INVALIDARG
,
"[%d] Expected MkParseDisplayNameEx to return E_INVALIDARG, got %08x
\n
"
,
i
,
hres
);
ok
(
eaten
==
0xdeadbeef
,
"[%d] Expected eaten to be 0xdeadbeef, got %u
\n
"
,
i
,
eaten
);
ok
(
mon
==
(
IMoniker
*
)
0xdeadbeef
,
"[%d] Expected mon to be 0xdeadbeef, got %p
\n
"
,
i
,
mon
);
}
hres
=
MkParseDisplayNameEx
(
bctx
,
url9
,
&
eaten
,
&
mon
);
ok
(
hres
==
S_OK
,
"MkParseDisplayNameEx failed: %08x
\n
"
,
hres
);
ok
(
eaten
==
sizeof
(
url9
)
/
sizeof
(
WCHAR
)
-
1
,
"eaten=%d
\n
"
,
eaten
);
...
...
dlls/urlmon/umon.c
View file @
c6e5e394
...
...
@@ -625,6 +625,9 @@ HRESULT WINAPI MkParseDisplayNameEx(IBindCtx *pbc, LPCWSTR szDisplayName, ULONG
{
TRACE
(
"(%p %s %p %p)
\n
"
,
pbc
,
debugstr_w
(
szDisplayName
),
pchEaten
,
ppmk
);
if
(
!
pbc
||
!
szDisplayName
||
!*
szDisplayName
||
!
pchEaten
||
!
ppmk
)
return
E_INVALIDARG
;
if
(
is_registered_protocol
(
szDisplayName
))
{
HRESULT
hres
;
...
...
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