[gimp/gimp-2-10] Issue #3093: Invalid characters in Open Location dialog crashes GIMP.



commit 1849ed9a34603b1ef1b1ddedd9385eedd0c5a460
Author: Jehan <jehan girinstud io>
Date:   Tue Jul 2 17:19:35 2019 +0200

    Issue #3093: Invalid characters in Open Location dialog crashes GIMP.
    
    Still a remaining CRITICAL. This was basically the same bug as commit
    cf8148df5e, but somewhere else.

 app/file/file-utils.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/app/file/file-utils.c b/app/file/file-utils.c
index 8211b96a87..230c1efde7 100644
--- a/app/file/file-utils.c
+++ b/app/file/file-utils.c
@@ -103,6 +103,18 @@ file_utils_filename_to_file (Gimp         *gimp,
 
   file = g_file_new_for_uri (filename);
 
+  if (! file)
+    {
+      /* Despite the docs says it never fails, it actually can on Windows.
+       * See issue #3093 (and glib#1819).
+       */
+      g_set_error_literal (error,
+                           G_CONVERT_ERROR,
+                           G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+                           _("Invalid character sequence in URI"));
+      return NULL;
+    }
+
   /*  check for prefixes like http or ftp  */
   if (gimp_plug_in_manager_file_procedure_find_by_prefix (gimp->plug_in_manager,
                                                           GIMP_FILE_PROCEDURE_GROUP_OPEN,


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