summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/pidfile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/lib/pidfile.c b/source3/lib/pidfile.c
index 1a462bf128..20a8e82ce2 100644
--- a/source3/lib/pidfile.c
+++ b/source3/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;