Paul Vriens : ole32/stg_bigblockfile: Check page before use (Coverity).

Alexandre Julliard julliard at wine.codeweavers.com
Wed Apr 4 12:32:26 CDT 2007


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

Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date:   Tue Apr  3 20:41:42 2007 +0200

ole32/stg_bigblockfile: Check page before use (Coverity).

---

 dlls/ole32/stg_bigblockfile.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/ole32/stg_bigblockfile.c b/dlls/ole32/stg_bigblockfile.c
index 08fc546..83454d4 100644
--- a/dlls/ole32/stg_bigblockfile.c
+++ b/dlls/ole32/stg_bigblockfile.c
@@ -861,18 +861,18 @@ static HRESULT WINAPI ImplBIGBLOCKFILE_WriteAt(
         MappedPage *page = BIGBLOCKFILE_GetMappedView(This, page_index);
 
         TRACE("page %i,  offset %u, bytes_to_page %u, bytes_left %u\n",
-            page->page_index, offset_in_page, bytes_to_page, bytes_left);
+            page ? page->page_index : 0, offset_in_page, bytes_to_page, bytes_left);
 
-        if (page->mapped_bytes < bytes_to_page)
+        if (!page)
         {
-            ERR("Not enough bytes mapped to the page. This should never happen\n");
+            ERR("Unable to get a page to write. This should never happen\n");
             rc = E_FAIL;
             break;
         }
 
-        if (!page)
+        if (page->mapped_bytes < bytes_to_page)
         {
-            ERR("Unable to get a page to write. This should never happen\n");
+            ERR("Not enough bytes mapped to the page. This should never happen\n");
             rc = E_FAIL;
             break;
         }




More information about the wine-cvs mailing list