aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolf <wolf@wolfsden.cz>2019-10-04 15:24:32 +0200
committerWilliam Hubbs <w.d.hubbs@gmail.com>2020-01-11 13:36:33 -0600
commit6deda13754f1b60245945e953cce8d97e40e86fc (patch)
tree883729b7364f56ad40baccd9215948eb293c2a81
parenteb610859519292c6164c4ba601d22e642c306beb (diff)
supervise-daemon: Fix segfault when executable does not exist
When executable is provided just by name (and therefore searched in a path), exec_file is reset to NULL every time. exists() handles it being NULL just fine, but dereferencing it in eerror does not work. Fixes #326 Fixes #327
-rw-r--r--src/rc/supervise-daemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index b754a42b..be424750 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -983,7 +983,7 @@ int main(int argc, char **argv)
}
if (!exists(exec_file)) {
eerror("%s: %s does not exist", applet,
- *exec_file ? exec_file : exec);
+ exec_file ? exec_file : exec);
free(exec_file);
exit(EXIT_FAILURE);
}