conf: do not deref null pointer

parent 89d09707
...@@ -3324,11 +3324,17 @@ static int unpriv_assign_nic(const char *lxcpath, char *lxcname, ...@@ -3324,11 +3324,17 @@ static int unpriv_assign_nic(const char *lxcpath, char *lxcname,
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
pidstr[LXC_NUMSTRLEN64 - 1] = '\0'; pidstr[LXC_NUMSTRLEN64 - 1] = '\0';
INFO("Execing lxc-user-nic %s %s %s veth %s %s", lxcpath, INFO("Execing lxc-user-nic create %s %s %s veth %s %s", lxcpath,
lxcname, pidstr, netdev_link, netdev->name); lxcname, pidstr, netdev_link,
execlp(LXC_USERNIC_PATH, LXC_USERNIC_PATH, lxcpath, lxcname, netdev->name ? netdev->name : "(null)");
pidstr, "veth", netdev_link, netdev->name, NULL); if (netdev->name)
execlp(LXC_USERNIC_PATH, LXC_USERNIC_PATH, "create",
lxcpath, lxcname, pidstr, "veth", netdev_link,
netdev->name, (char *)NULL);
else
execlp(LXC_USERNIC_PATH, LXC_USERNIC_PATH, "create",
lxcpath, lxcname, pidstr, "veth", netdev_link,
(char *)NULL);
SYSERROR("Failed to exec lxc-user-nic."); SYSERROR("Failed to exec lxc-user-nic.");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
......
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