From 994b589377d3e13ceab445f96b33e4fed4c35ffb Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Fri, 5 Feb 2016 22:55:39 +0100 Subject: [PATCH] Fix Coverity warning for possible NULL ptr dereference Add check for return value from strtok() Signed-off-by: Joachim Nilsson --- plugins/pidfile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/pidfile.c b/plugins/pidfile.c index e70fc9bf..a0d8da5a 100644 --- a/plugins/pidfile.c +++ b/plugins/pidfile.c @@ -36,6 +36,9 @@ static void pidfile_callback(void *UNUSED(arg), int fd, int UNUSED(events)) continue; basename = strtok(ev->name, "."); + if (!basename) + continue; + svc = svc_find_by_nameid(basename, 1); if (!svc) continue;