Marcus Meissner : ole32: Fixed 2 uninitialized variable use (Coverity).

Alexandre Julliard julliard at winehq.org
Mon May 10 11:59:10 CDT 2010


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

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Sat May  8 23:50:18 2010 +0200

ole32: Fixed 2 uninitialized variable use (Coverity).

---

 dlls/ole32/storage32.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index bc1fb96..d136837 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -4096,9 +4096,11 @@ static HRESULT StorageBaseImpl_CopyStream(
       if (SUCCEEDED(hr))
         hr = StorageBaseImpl_StreamWriteAt(dst, dst_entry, bytes_copied, bytestocopy,
           data, &byteswritten);
-      if (SUCCEEDED(hr) && byteswritten != bytestocopy) hr = STG_E_WRITEFAULT;
-
-      bytes_copied.QuadPart += byteswritten;
+      if (SUCCEEDED(hr))
+      {
+        if (byteswritten != bytestocopy) hr = STG_E_WRITEFAULT;
+        bytes_copied.QuadPart += byteswritten;
+      }
     }
   }
 
@@ -4370,7 +4372,7 @@ static HRESULT TransactedSnapshotImpl_CopyTree(TransactedSnapshotImpl* This)
 {
   DirRef cursor;
   TransactedDirEntry *entry;
-  HRESULT hr;
+  HRESULT hr = S_OK;
 
   cursor = This->base.storageDirEntry;
   entry = &This->entries[cursor];




More information about the wine-cvs mailing list