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
086a91fa
Commit
086a91fa
authored
Aug 03, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Aug 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Check some of the input parameters to URLOpenStreamA/W & URLOpenBlockingStreamA/W for NULL.
Add tests for these.
parent
a5da813f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
stream.c
dlls/urlmon/tests/stream.c
+8
-0
umstream.c
dlls/urlmon/umstream.c
+15
-0
No files found.
dlls/urlmon/tests/stream.c
View file @
086a91fa
...
@@ -297,6 +297,11 @@ static void test_URLOpenBlockingStreamW(void)
...
@@ -297,6 +297,11 @@ static void test_URLOpenBlockingStreamW(void)
IStream
*
pStream
;
IStream
*
pStream
;
char
buffer
[
256
];
char
buffer
[
256
];
hr
=
URLOpenBlockingStreamW
(
NULL
,
NULL
,
&
pStream
,
0
,
&
BindStatusCallback
);
ok
(
hr
==
E_INVALIDARG
,
"URLOpenBlockingStreamW should have failed with E_INVALIDARG instead of 0x%08x
\n
"
,
hr
);
hr
=
URLOpenBlockingStreamW
(
NULL
,
INDEX_HTML
,
NULL
,
0
,
&
BindStatusCallback
);
ok
(
hr
==
E_INVALIDARG
,
"URLOpenBlockingStreamW should have failed with E_INVALIDARG instead of 0x%08x
\n
"
,
hr
);
SET_EXPECT
(
GetBindInfo
);
SET_EXPECT
(
GetBindInfo
);
SET_EXPECT
(
QueryInterface_IServiceProvider
);
SET_EXPECT
(
QueryInterface_IServiceProvider
);
SET_EXPECT
(
OnStartBinding
);
SET_EXPECT
(
OnStartBinding
);
...
@@ -331,6 +336,9 @@ static void test_URLOpenStreamW(void)
...
@@ -331,6 +336,9 @@ static void test_URLOpenStreamW(void)
{
{
HRESULT
hr
;
HRESULT
hr
;
hr
=
URLOpenStreamW
(
NULL
,
NULL
,
0
,
&
BindStatusCallback
);
ok
(
hr
==
E_INVALIDARG
,
"URLOpenStreamW should have failed with E_INVALIDARG instead of 0x%08x
\n
"
,
hr
);
SET_EXPECT
(
GetBindInfo
);
SET_EXPECT
(
GetBindInfo
);
SET_EXPECT
(
QueryInterface_IServiceProvider
);
SET_EXPECT
(
QueryInterface_IServiceProvider
);
SET_EXPECT
(
OnStartBinding
);
SET_EXPECT
(
OnStartBinding
);
...
...
dlls/urlmon/umstream.c
View file @
086a91fa
...
@@ -559,10 +559,16 @@ HRESULT WINAPI URLOpenBlockingStreamA(LPUNKNOWN pCaller, LPCSTR szURL,
...
@@ -559,10 +559,16 @@ HRESULT WINAPI URLOpenBlockingStreamA(LPUNKNOWN pCaller, LPCSTR szURL,
TRACE
(
"(%p, %s, %p, 0x%x, %p)
\n
"
,
pCaller
,
szURL
,
ppStream
,
dwReserved
,
lpfnCB
);
TRACE
(
"(%p, %s, %p, 0x%x, %p)
\n
"
,
pCaller
,
szURL
,
ppStream
,
dwReserved
,
lpfnCB
);
if
(
!
szURL
||
!
ppStream
)
return
E_INVALIDARG
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szURL
,
-
1
,
NULL
,
0
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szURL
,
-
1
,
NULL
,
0
);
szURLW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
szURLW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
szURLW
)
if
(
!
szURLW
)
{
*
ppStream
=
NULL
;
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
MultiByteToWideChar
(
CP_ACP
,
0
,
szURL
,
-
1
,
szURLW
,
len
);
MultiByteToWideChar
(
CP_ACP
,
0
,
szURL
,
-
1
,
szURLW
,
len
);
hr
=
URLOpenBlockingStreamW
(
pCaller
,
szURLW
,
ppStream
,
dwReserved
,
lpfnCB
);
hr
=
URLOpenBlockingStreamW
(
pCaller
,
szURLW
,
ppStream
,
dwReserved
,
lpfnCB
);
...
@@ -584,6 +590,9 @@ HRESULT WINAPI URLOpenBlockingStreamW(LPUNKNOWN pCaller, LPCWSTR szURL,
...
@@ -584,6 +590,9 @@ HRESULT WINAPI URLOpenBlockingStreamW(LPUNKNOWN pCaller, LPCWSTR szURL,
TRACE
(
"(%p, %s, %p, 0x%x, %p)
\n
"
,
pCaller
,
debugstr_w
(
szURL
),
ppStream
,
TRACE
(
"(%p, %s, %p, 0x%x, %p)
\n
"
,
pCaller
,
debugstr_w
(
szURL
),
ppStream
,
dwReserved
,
lpfnCB
);
dwReserved
,
lpfnCB
);
if
(
!
szURL
||
!
ppStream
)
return
E_INVALIDARG
;
blocking_bsc
.
lpVtbl
=
&
BlockingBindStatusCallbackVtbl
;
blocking_bsc
.
lpVtbl
=
&
BlockingBindStatusCallbackVtbl
;
blocking_bsc
.
pBSC
=
lpfnCB
;
blocking_bsc
.
pBSC
=
lpfnCB
;
...
@@ -602,6 +611,9 @@ HRESULT WINAPI URLOpenStreamA(LPUNKNOWN pCaller, LPCSTR szURL, DWORD dwReserved,
...
@@ -602,6 +611,9 @@ HRESULT WINAPI URLOpenStreamA(LPUNKNOWN pCaller, LPCSTR szURL, DWORD dwReserved,
TRACE
(
"(%p, %s, 0x%x, %p)
\n
"
,
pCaller
,
szURL
,
dwReserved
,
lpfnCB
);
TRACE
(
"(%p, %s, 0x%x, %p)
\n
"
,
pCaller
,
szURL
,
dwReserved
,
lpfnCB
);
if
(
!
szURL
)
return
E_INVALIDARG
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szURL
,
-
1
,
NULL
,
0
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szURL
,
-
1
,
NULL
,
0
);
szURLW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
szURLW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
szURLW
)
if
(
!
szURLW
)
...
@@ -628,6 +640,9 @@ HRESULT WINAPI URLOpenStreamW(LPUNKNOWN pCaller, LPCWSTR szURL, DWORD dwReserved
...
@@ -628,6 +640,9 @@ HRESULT WINAPI URLOpenStreamW(LPUNKNOWN pCaller, LPCWSTR szURL, DWORD dwReserved
TRACE
(
"(%p, %s, 0x%x, %p)
\n
"
,
pCaller
,
debugstr_w
(
szURL
),
dwReserved
,
TRACE
(
"(%p, %s, 0x%x, %p)
\n
"
,
pCaller
,
debugstr_w
(
szURL
),
dwReserved
,
lpfnCB
);
lpfnCB
);
if
(
!
szURL
)
return
E_INVALIDARG
;
async_bsc
.
lpVtbl
=
&
AsyncBindStatusCallbackVtbl
;
async_bsc
.
lpVtbl
=
&
AsyncBindStatusCallbackVtbl
;
async_bsc
.
pBSC
=
lpfnCB
;
async_bsc
.
pBSC
=
lpfnCB
;
...
...
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