Mike McCormack : msi: Avoid crashing if writeout_cabinet_stream fails.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Oct 27 05:49:23 CDT 2006


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

Author: Mike McCormack <mike at codeweavers.com>
Date:   Fri Oct 27 17:29:19 2006 +0900

msi: Avoid crashing if writeout_cabinet_stream fails.

---

 dlls/msi/files.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index 99cc6b5..6c5b288 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -490,11 +490,16 @@ static UINT ready_media_for_file( MSIPAC
         /* the stream does not contain the # character */
         if (cab[0]=='#')
         {
-            LPWSTR path;
+            LPWSTR path, p;
+
+            rc = writeout_cabinet_stream(package,&cab[1],mi->source);
+            if (rc != ERROR_SUCCESS)
+                return rc;
 
-            writeout_cabinet_stream(package,&cab[1],mi->source);
             mi->last_path = strdupW(mi->source);
-            *(strrchrW(mi->last_path,'\\')+1)=0;
+            p = strrchrW(mi->last_path,'\\');
+            if (p)
+                p[1] = 0;
 
             path = msi_dup_property( package, cszSourceDir );
 




More information about the wine-cvs mailing list