From: Christian Brauner Date: Mon, 26 Feb 2018 14:30:56 +0000 (+0100) Subject: lxc-snapshot: fix segfault X-Git-Tag: lxc-2.0.10~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=071b170479c62ef682d7c1aebaac56fb1949667b;p=thirdparty%2Flxc.git lxc-snapshot: fix segfault https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1751780 Signed-off-by: Christian Brauner --- diff --git a/src/lxc/tools/lxc_snapshot.c b/src/lxc/tools/lxc_snapshot.c index 79dc5c336..50d2982fe 100644 --- a/src/lxc/tools/lxc_snapshot.c +++ b/src/lxc/tools/lxc_snapshot.c @@ -128,6 +128,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);