From 08a1599aaad7c87e7c5b071813ea4c2b4efcdfd6 Mon Sep 17 00:00:00 2001 From: Sai Asish Y Date: Sat, 18 Jul 2026 13:56:46 -0700 Subject: [PATCH] Fix segfault on search URI parameter with no value Signed-off-by: Sai Asish Y --- src/modules/vfs-search.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/modules/vfs-search.c b/src/modules/vfs-search.c index 57a375c4..e99238ca 100644 --- a/src/modules/vfs-search.c +++ b/src/modules/vfs-search.c @@ -482,6 +482,21 @@ static void parse_search_uri(FmVfsSearchEnumerator* priv, const char* uri_str) /* g_printf("parameter name/value: %s = %s\n", name, value); */ + /* a parameter with no value (e.g. "show_hidden" instead of + * "show_hidden=1") carries no information; skip it rather than + * dereferencing the NULL value below */ + if(value == NULL) + { + g_free(name); + if(sep) + { + params = sep + 1; + continue; + } + else + break; + } + if(strcmp(name, "show_hidden") == 0) priv->show_hidden = (value[0] == '1') ? TRUE : FALSE; else if(strcmp(name, "recursive") == 0)