diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/lib/pidfile.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/lib/pidfile.c b/source/lib/pidfile.c index 1a462bf1287..20a8e82ce23 100644 --- a/source/lib/pidfile.c +++ b/source/lib/pidfile.c @@ -49,6 +49,13 @@ pid_t pidfile_pid(const char *name) } ret = atoi(pidstr); + + if (ret == 0) { + /* Obviously we had some garbage in the pidfile... */ + DEBUG(1, ("Could not parse contents of pidfile %s\n", + pidFile)); + goto noproc; + } if (!process_exists((pid_t)ret)) { goto noproc; |