From: Christian Brauner Date: Sat, 20 Oct 2018 09:57:02 +0000 (+0200) Subject: coverity: #1440391 X-Git-Tag: lxc-3.1.0~29^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=637d38f2465eda9bfb0f56e43c99ba39bbe09e70;p=thirdparty%2Flxc.git coverity: #1440391 Dereference null return value Signed-off-by: Christian Brauner --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 68d36489e..e1f4266b6 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -3489,8 +3489,10 @@ static int get_config_hooks(const char *key, char *retv, int inlen, return -1; subkey = strchr(subkey + 1, '.'); + if (!subkey) + return -1; subkey++; - if (!*subkey) + if (*subkey == '\0') return -1; for (i = 0; i < NUM_LXC_HOOKS; i++) {