Skip to content

Commit ae8a77e

Browse files
committed
nemo-search-engine-advanced.c: Escape paths properly before passing
them to search helpers. We were quoting paths but not escaping any quotes of the same type within the path. Also add missing return when g_shell_parse_argv() fails. Fixes #2768
1 parent 71d12d5 commit ae8a77e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libnemo-private/nemo-search-engine-advanced.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ get_stream_from_helper (SearchHelper *helper,
647647
gchar *ptr, *path, *quoted;
648648

649649
path = g_file_get_path (file);
650-
quoted = g_strdup_printf ("\"%s\"", path);
650+
quoted = g_shell_quote (path);
651651
g_free (path);
652652

653653
command_line = g_string_new (helper->exec_format);
@@ -670,6 +670,7 @@ get_stream_from_helper (SearchHelper *helper,
670670
error)) {
671671
g_string_free (command_line, TRUE);
672672
g_free (quoted);
673+
return NULL;
673674
}
674675

675676
flags = G_SUBPROCESS_FLAGS_STDOUT_PIPE;

0 commit comments

Comments
 (0)