[msitools] Ignore empty cab file names to prevent attempts to open them



commit b01459f9eee8566423f795283c48e1f38570adfd
Author: est31 <MTest31 outlook com>
Date:   Wed Oct 18 17:24:20 2017 +0200

    Ignore empty cab file names to prevent attempts to open them
    
    Some msi files reference cab file names, which need to be ignored.
    If we don't ignore them, msiextract will attempt to open them which
    leads to an error. See [1] and [2].
    
    [1]: https://bugzilla.gnome.org/show_bug.cgi?id=789020
    [2]: https://github.com/activescott/lessmsi/issues/49
    
    Reviewed-by: Marc-André Lureau <marcandre lureau redhat com>

 tools/msiextract.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/tools/msiextract.vala b/tools/msiextract.vala
index ae02068..f19e07c 100644
--- a/tools/msiextract.vala
+++ b/tools/msiextract.vala
@@ -143,6 +143,10 @@ public void extract (string filename) throws GLib.Error {
     query.execute ();
     while ((rec = query.fetch ()) != null) {
         var cab = rec.get_string (4);
+        if (cab == "") {
+            // Ignore empty cab names
+            continue;
+        }
         extract_cab (db, cab, cab_to_name);
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]