From ddb15acfdeecd61058257bb664c39ec36f2c5d7b Mon Sep 17 00:00:00 2001 From: phillbush Date: Fri, 29 May 2020 23:55:37 -0300 Subject: [PATCH] Fixing segfault in case of empty input --- xmenu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xmenu.c b/xmenu.c index 5fefae8..31984fb 100644 --- a/xmenu.c +++ b/xmenu.c @@ -379,6 +379,8 @@ parsestdin(void) char *label, *output; unsigned level = 0; + rootmenu = NULL; + while (fgets(buf, BUFSIZ, stdin) != NULL) { /* get the indentation level */ level = strspn(buf, "\t");