[file-roller/gnome-3-26] unarchiver: check that XADFileSize is set before reading it



commit fe422f7c6b42a0d618b2b49999cfb2210f9ceca5
Author: Mike Gorse <mgorse suse com>
Date:   Mon Dec 11 21:34:40 2017 -0600

    unarchiver: check that XADFileSize is set before reading it
    
    Lsar does not set XADFileSize for directories, so we would output a
    critical when encountering one.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791505

 src/fr-command-unarchiver.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/fr-command-unarchiver.c b/src/fr-command-unarchiver.c
index a7cdb83..5e8fd70 100644
--- a/src/fr-command-unarchiver.c
+++ b/src/fr-command-unarchiver.c
@@ -91,7 +91,8 @@ list_command_completed (gpointer data)
 
                                entry = json_array_get_object_element (content, i);
                                fdata = file_data_new ();
-                               fdata->size = json_object_get_int_member (entry, "XADFileSize");
+                               if (json_object_has_member (entry, "XADFileSize"))
+                                       fdata->size = json_object_get_int_member (entry, "XADFileSize");
                                fdata->modified = mktime_from_string (json_object_get_string_member (entry, 
"XADLastModificationDate"));
                                if (json_object_has_member (entry, "XADIsEncrypted"))
                                        fdata->encrypted = json_object_get_int_member (entry, 
"XADIsEncrypted") == 1;


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