diff options
author | Corey Berla <corey@berla.me> | 2022-12-04 09:07:49 -1000 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2022-12-23 16:04:21 +0000 |
commit | 8f989fa39fd53932597efdf9e728a88b4337fef9 (patch) | |
tree | fddee2b761910b2f5ebc718931088a163a4c22e0 | |
parent | e2969a9c29d0d171038fcb35d8baa5a7df372191 (diff) | |
download | nautilus-8f989fa39fd53932597efdf9e728a88b4337fef9.tar.gz |
dbus-manager: Fix another crash from invalid dbus innvocation
Passing an invalid uri to create-folder also crashes nautilus.
If the parent_file is NULL, return an error instead of crashes.
-rw-r--r-- | src/nautilus-dbus-manager.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nautilus-dbus-manager.c b/src/nautilus-dbus-manager.c index 6736205d1..b4c13f115 100644 --- a/src/nautilus-dbus-manager.c +++ b/src/nautilus-dbus-manager.c @@ -187,6 +187,11 @@ handle_create_folder (NautilusDBusFileOperations *object, file = g_file_new_for_uri (uri); basename = g_file_get_basename (file); parent_file = g_file_get_parent (file); + if (parent_file == NULL || basename == NULL) + { + g_dbus_method_invocation_return_error (invocation, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, "Invalid uri: %s", uri); + return TRUE; + } parent_file_uri = g_file_get_uri (parent_file); handle_create_folder_internal (parent_file_uri, basename, NULL); |