Skip to content

Commit

Permalink
coverity: #1440391
Browse files Browse the repository at this point in the history
Dereference null return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Nov 22, 2018
1 parent e62f1fe commit e92e31d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lxc/confile.c
Expand Up @@ -3272,8 +3272,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++) {
Expand Down

0 comments on commit e92e31d

Please sign in to comment.