From: Orestis Floros Date: Mon, 25 Sep 2017 23:50:10 +0000 (+0300) Subject: i3bar: fix segfault when no status_command is provided X-Git-Tag: 4.15~61^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F2992%2Fhead;p=i3%2Fi3 i3bar: fix segfault when no status_command is provided Fixes #2933. --- diff --git a/i3bar/src/ipc.c b/i3bar/src/ipc.c index c932aaf7..49c729ae 100644 --- a/i3bar/src/ipc.c +++ b/i3bar/src/ipc.c @@ -177,7 +177,7 @@ void got_bar_config_update(char *event) { /* update the configuration with the received settings */ DLOG("Received bar config update \"%s\"\n", event); - char *old_command = sstrdup(config.command); + char *old_command = config.command ? sstrdup(config.command) : NULL; bar_display_mode_t old_mode = config.hide_on_modifier; parse_config_json(event); if (old_mode != config.hide_on_modifier) { @@ -189,7 +189,7 @@ void got_bar_config_update(char *event) { init_colors(&(config.colors)); /* restart status command process */ - if (strcmp(old_command, config.command) != 0) { + if (old_command && strcmp(old_command, config.command) != 0) { kill_child(); start_child(config.command); }