storage: avoid segfault

When the "lxc.rootfs.path" property is not set and users request a container copy we would segfault since strstr() would be called on a NULL pointer. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 76bdf299
......@@ -337,6 +337,11 @@ struct lxc_storage *storage_copy(struct lxc_container *c, const char *cname,
struct rsync_data data = {0};
char cmd_output[MAXPATHLEN] = {0};
if (!src) {
ERROR("No rootfs specified");
return NULL;
}
/* If the container name doesn't show up in the rootfs path, then we
* don't know how to come up with a new name.
*/
......
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