From 0d19842aa1661d27d8b4195272a27585ae6c9e45 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 24 Dec 2017 10:35:07 +0100 Subject: [PATCH] conf_changed(): Fix possible NULL ptr deref, found by Coverity Scan Signed-off-by: Joachim Nilsson --- src/conf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/conf.c b/src/conf.c index 813ef68e..6906fd55 100644 --- a/src/conf.c +++ b/src/conf.c @@ -619,7 +619,10 @@ int conf_changed(char *file) { char *ptr; - if (file && (ptr = strrchr(file, '/'))) + if (!file) + return 0; + + if ((ptr = strrchr(file, '/'))) file = ++ptr; if (conf_find(file))