Unverified Commit f50520d5 by Maximilian Blenk Committed by Christian Brauner

container.conf: Fix off by 2 in option parsing

This commit fixes a off by 2 in config option parsing (due to missing parenthesis). The error occurs if for instance lxc.net.0.type is parsed. In that case, the .0 is removed from the string. However, due to the missing parenthesis, the null terminating character is off by two which means the modified config option would be lxc.net.typepe instead of lxc.net.type. Signed-off-by: 's avatarMaximilian Blenk <Maximilian.Blenk@bmw.de>
parent 834e11b6
...@@ -4240,7 +4240,7 @@ static struct lxc_config_t *get_network_config_ops(const char *key, ...@@ -4240,7 +4240,7 @@ static struct lxc_config_t *get_network_config_ops(const char *key,
} }
memmove(copy + 8, idx_end + 1, strlen(idx_end + 1)); memmove(copy + 8, idx_end + 1, strlen(idx_end + 1));
copy[strlen(key) - numstrlen + 1] = '\0'; copy[strlen(key) - (numstrlen + 1)] = '\0';
config = lxc_get_config(copy); config = lxc_get_config(copy);
if (!config) { if (!config) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment