From da76cf4f75c12ea6fe6d39d095136389318e99b4 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 10 Apr 2016 19:58:46 +0200 Subject: [PATCH] Check return value from strtok(), may be NULL 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 5966fe2a..7fdb4f6e 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;