Jacek Caban : mshtml: Correctly handle NULL nschannel in channelbsc_load_stream (Coverity).

Alexandre Julliard julliard at winehq.org
Thu Nov 12 10:22:12 CST 2009


Module: wine
Branch: master
Commit: aa714ca16903d139a025bce4177a27597415a323
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=aa714ca16903d139a025bce4177a27597415a323

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Nov 12 14:51:43 2009 +0100

mshtml: Correctly handle NULL nschannel in channelbsc_load_stream (Coverity).

---

 dlls/mshtml/navigate.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c
index 3a1644c..727eaef 100644
--- a/dlls/mshtml/navigate.c
+++ b/dlls/mshtml/navigate.c
@@ -1142,12 +1142,16 @@ HRESULT channelbsc_load_stream(nsChannelBSC *bscallback, IStream *stream)
 {
     HRESULT hres;
 
-    const char text_html[] = "text/html";
+    if(!bscallback->nschannel) {
+        ERR("NULL nschannel\n");
+        return E_FAIL;
+    }
 
-    add_nsrequest(bscallback);
+    bscallback->nschannel->content_type = heap_strdupA("text/html");
+    if(!bscallback->nschannel->content_type)
+        return E_OUTOFMEMORY;
 
-    if(bscallback->nschannel)
-        bscallback->nschannel->content_type = heap_strdupA(text_html);
+    add_nsrequest(bscallback);
 
     hres = read_stream_data(bscallback, stream);
     IBindStatusCallback_OnStopBinding(STATUSCLB(&bscallback->bsc), hres, ERROR_SUCCESS);




More information about the wine-cvs mailing list