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
b6227fc4
Commit
b6227fc4
authored
Oct 19, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Properly handle OOM errors in navigate.c (coverity).
parent
421368b8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
navigate.c
dlls/mshtml/navigate.c
+20
-14
No files found.
dlls/mshtml/navigate.c
View file @
b6227fc4
...
@@ -215,7 +215,11 @@ static const nsIInputStreamVtbl nsInputStreamVtbl = {
...
@@ -215,7 +215,11 @@ static const nsIInputStreamVtbl nsInputStreamVtbl = {
static
nsProtocolStream
*
create_nsprotocol_stream
(
void
)
static
nsProtocolStream
*
create_nsprotocol_stream
(
void
)
{
{
nsProtocolStream
*
ret
=
heap_alloc
(
sizeof
(
nsProtocolStream
));
nsProtocolStream
*
ret
;
ret
=
heap_alloc
(
sizeof
(
nsProtocolStream
));
if
(
!
ret
)
return
NULL
;
ret
->
nsIInputStream_iface
.
lpVtbl
=
&
nsInputStreamVtbl
;
ret
->
nsIInputStream_iface
.
lpVtbl
=
&
nsInputStreamVtbl
;
ret
->
ref
=
1
;
ret
->
ref
=
1
;
...
@@ -877,8 +881,10 @@ static HRESULT BufferBSC_read_data(BSCallback *bsc, IStream *stream)
...
@@ -877,8 +881,10 @@ static HRESULT BufferBSC_read_data(BSCallback *bsc, IStream *stream)
HRESULT
hres
;
HRESULT
hres
;
if
(
!
This
->
buf
)
{
if
(
!
This
->
buf
)
{
This
->
buf
=
heap_alloc
(
128
);
if
(
!
This
->
buf
)
return
E_OUTOFMEMORY
;
This
->
size
=
128
;
This
->
size
=
128
;
This
->
buf
=
heap_alloc
(
This
->
size
);
}
}
do
{
do
{
...
@@ -921,23 +927,20 @@ static const BSCallbackVtbl BufferBSCVtbl = {
...
@@ -921,23 +927,20 @@ static const BSCallbackVtbl BufferBSCVtbl = {
};
};
static
BufferBSC
*
create_bufferbsc
(
IMoniker
*
mon
)
{
BufferBSC
*
ret
=
heap_alloc_zero
(
sizeof
(
*
ret
));
init_bscallback
(
&
ret
->
bsc
,
&
BufferBSCVtbl
,
mon
,
0
);
ret
->
hres
=
E_FAIL
;
return
ret
;
}
HRESULT
bind_mon_to_wstr
(
HTMLInnerWindow
*
window
,
IMoniker
*
mon
,
WCHAR
**
ret
)
HRESULT
bind_mon_to_wstr
(
HTMLInnerWindow
*
window
,
IMoniker
*
mon
,
WCHAR
**
ret
)
{
{
BufferBSC
*
bsc
=
create_bufferbsc
(
mon
)
;
BufferBSC
*
bsc
;
int
cp
=
CP_ACP
;
int
cp
=
CP_ACP
;
WCHAR
*
text
;
WCHAR
*
text
;
HRESULT
hres
;
HRESULT
hres
;
bsc
=
heap_alloc_zero
(
sizeof
(
*
bsc
));
if
(
!
bsc
)
return
E_OUTOFMEMORY
;
init_bscallback
(
&
bsc
->
bsc
,
&
BufferBSCVtbl
,
mon
,
0
);
bsc
->
hres
=
E_FAIL
;
hres
=
start_binding
(
window
,
&
bsc
->
bsc
,
NULL
);
hres
=
start_binding
(
window
,
&
bsc
->
bsc
,
NULL
);
if
(
SUCCEEDED
(
hres
))
if
(
SUCCEEDED
(
hres
))
hres
=
bsc
->
hres
;
hres
=
bsc
->
hres
;
...
@@ -1164,8 +1167,11 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
...
@@ -1164,8 +1167,11 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
return
S_OK
;
return
S_OK
;
}
}
if
(
!
This
->
nsstream
)
if
(
!
This
->
nsstream
)
{
This
->
nsstream
=
create_nsprotocol_stream
();
This
->
nsstream
=
create_nsprotocol_stream
();
if
(
!
This
->
nsstream
)
return
E_OUTOFMEMORY
;
}
do
{
do
{
BOOL
first_read
=
!
This
->
bsc
.
readed
;
BOOL
first_read
=
!
This
->
bsc
.
readed
;
...
...
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