From 05b09358b97f8790a9f9bf64d8fc5a41924d6404 Mon Sep 17 00:00:00 2001 From: Michal Bloch Date: Fri, 14 Feb 2020 11:19:11 +0100 Subject: [PATCH] Fix a potential nullptr dereference Change-Id: I275822967bd3cc91214cacaf24fbc8bb223cd96c Signed-off-by: Michal Bloch --- src/system-recovery/recovery-headless.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/system-recovery/recovery-headless.c b/src/system-recovery/recovery-headless.c index e07035c..3640262 100644 --- a/src/system-recovery/recovery-headless.c +++ b/src/system-recovery/recovery-headless.c @@ -37,6 +37,8 @@ static char *get_action_from_config(config_t *cfg) return NULL; action = config_setting_get_string(node); + if (!action) + return NULL; return strdup(action); } -- 2.7.4