[lxc-devel] [lxc/master] lxc-snapshot: fix segfault
brauner on Github
lxc-bot at linuxcontainers.org
Mon Feb 26 14:31:44 UTC 2018
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 426 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180226/e7694a06/attachment.bin>
-------------- next part --------------
From 07d7dc94383a4978bce4ae084f653139a602cf4b Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 26 Feb 2018 15:30:56 +0100
Subject: [PATCH] lxc-snapshot: fix segfault
https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1751780
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
src/lxc/tools/lxc_snapshot.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/lxc/tools/lxc_snapshot.c b/src/lxc/tools/lxc_snapshot.c
index 19542b374..52ddd8fe9 100644
--- a/src/lxc/tools/lxc_snapshot.c
+++ b/src/lxc/tools/lxc_snapshot.c
@@ -126,6 +126,12 @@ int main(int argc, char *argv[])
}
}
+ if (!c->lxc_conf) {
+ fprintf(stderr, "No container config specified\n");
+ lxc_container_put(c);
+ exit(EXIT_FAILURE);
+ }
+
if (!c->may_control(c)) {
fprintf(stderr, "Insufficent privileges to control %s\n",
my_args.name);
More information about the lxc-devel
mailing list