Hans Leidekker : msi: Avoid a crash when the cabinet file must be downloaded.

Alexandre Julliard julliard at winehq.org
Wed Jun 23 10:57:06 CDT 2010


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Jun 23 10:44:26 2010 +0200

msi: Avoid a crash when the cabinet file must be downloaded.

Fixes a regression caused by e5869d5d5c8f01b140ac5fba1044f3c10975612c.

---

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

diff --git a/dlls/msi/media.c b/dlls/msi/media.c
index b455775..6dc262c 100644
--- a/dlls/msi/media.c
+++ b/dlls/msi/media.c
@@ -785,13 +785,17 @@ UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi)
     {
         WCHAR temppath[MAX_PATH], *p;
 
-        msi_download_file(cabinet_file, temppath);
+        rc = msi_download_file(cabinet_file, temppath);
+        if (rc != ERROR_SUCCESS)
+        {
+            ERR("Failed to download %s (%u)\n", debugstr_w(cabinet_file), rc);
+            msi_free(cabinet_file);
+            return rc;
+        }
         if ((p = strrchrW(temppath, '\\'))) *p = 0;
-
-        msi_free(mi->sourcedir);
         strcpyW(mi->sourcedir, temppath);
         msi_free(mi->cabinet);
-        strcpyW(mi->cabinet, p + 1);
+        mi->cabinet = strdupW(p + 1);
 
         msi_free(cabinet_file);
         return ERROR_SUCCESS;




More information about the wine-cvs mailing list