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++) {