From 5af07b74100cf59a217e0cda6f9dbbed5fd525c5 Mon Sep 17 00:00:00 2001 From: Scoopta Date: Sat, 20 Jan 2024 20:07:03 -0800 Subject: [PATCH] Fixed segfault when running non shell safe inputs with --pre-display-cmd and --allow-images Ex. echo '"' | wofi --dmenu --pre-display-cmd "echo %s" --allow-images --- src/wofi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wofi.c b/src/wofi.c index 2e6a650..8970712 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -268,6 +268,9 @@ static char* parse_images(WofiPropertyBox* box, const char* text, bool create_wi map_put(mode_map, "img-base64-noscale", "true"); map_put(mode_map, "text", "true"); + if(text == NULL) { + return NULL; + } char* original = strdup(text); char* mode1 = NULL; char* mode2 = NULL;