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
This commit is contained in:
Scoopta 2024-01-20 20:07:03 -08:00
parent 1f5161eb66
commit 5af07b7410

View File

@ -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, "img-base64-noscale", "true");
map_put(mode_map, "text", "true"); map_put(mode_map, "text", "true");
if(text == NULL) {
return NULL;
}
char* original = strdup(text); char* original = strdup(text);
char* mode1 = NULL; char* mode1 = NULL;
char* mode2 = NULL; char* mode2 = NULL;