This prevent an infinite recursion in the case of "lxc.net.0. = a"
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
/* lxc.net.<idx>.<subkey> */
if (idx_end) {
*idx_end = '.';
+ if (strlen(idx_end + 1) == 0) {
+ ERROR("No subkey in network configuration key \"%s\"", key);
+ goto on_error;
+ }
memmove(copy + 8, idx_end + 1, strlen(idx_end + 1));
copy[strlen(key) - numstrlen + 1] = '\0';
if (!p)
goto out;
+ if (strlen(p + 1) == 0) {
+ ERROR("No subkey in network configuration key \"%s\"", key);
+ goto out;
+ }
strcpy(copy + 12, p + 1);
config = lxc_get_config(copy);
if (!config) {
return -1;
}
+ if (c->set_config_item(c, "lxc.net.0.", "veth")) {
+ lxc_error("%s\n", "lxc.net.0. should be invalid");
+ return -1;
+ }
+
+ if (c->set_config_item(c, "lxc.network.0.", "veth")) {
+ lxc_error("%s\n", "lxc.network.0. should be invalid");
+ return -1;
+ }
+
c->clear_config(c);
c->lxc_conf = NULL;