]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: #1440391
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 20 Oct 2018 09:57:02 +0000 (11:57 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 22 Oct 2018 14:48:37 +0000 (16:48 +0200)
Dereference null return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index 68d36489e7bfbf97b7f3f07f84394b3222f43c61..e1f4266b6c93ac5d066807b20b07a22953ee9926 100644 (file)
@@ -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++) {