diff options
author | Richard Hughes <richard@hughsie.com> | 2015-10-15 21:26:11 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-10-15 21:26:54 +0100 |
commit | 4c9f8fdd43c4be5159f4e4a41f95fb82738e17df (patch) | |
tree | d2c7cd07ad6e2886258b2f3652158fb5d0d6240f | |
parent | f5f4dfc113fd52cff880815f9ed62feee701ca61 (diff) | |
download | appstream-glib-4c9f8fdd43c4be5159f4e4a41f95fb82738e17df.tar.gz |
Only accept UNIX paths for files in cab files
Perhaps resolves: https://github.com/hughsie/appstream-glib/issues/68
-rw-r--r-- | libappstream-glib/as-store-cab.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libappstream-glib/as-store-cab.c b/libappstream-glib/as-store-cab.c index 912700f..5c012d9 100644 --- a/libappstream-glib/as-store-cab.c +++ b/libappstream-glib/as-store-cab.c @@ -39,7 +39,14 @@ static gboolean as_store_cab_cb (GCabFile *file, gpointer user_data) { GPtrArray *filelist = (GPtrArray *) user_data; - g_ptr_array_add (filelist, g_strdup (gcab_file_get_name (file))); + gchar *fn; + + /* only accept UNIX paths */ + fn = g_strdup (gcab_file_get_name (file)); + g_strdelimit (fn, "\\", '/'); + gcab_file_set_extract_name (file, fn); + + g_ptr_array_add (filelist, fn); return TRUE; } |