From: Oliver Matthews Date: Sun, 25 Sep 2016 08:37:43 +0000 (+0100) Subject: Fix null derefence if attach is called without access to any tty X-Git-Tag: lxc-2.1.0~316^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1206%2Fhead;p=thirdparty%2Flxc.git Fix null derefence if attach is called without access to any tty Signed-off-by: Oliver Matthews --- diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c index 9d7138835..23d63a22b 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -321,7 +321,7 @@ static int get_pty_on_host(struct lxc_container *c, struct wrapargs *wrap, int * err3: lxc_mainloop_close(&descr); err2: - if (ts->sigfd != -1) + if (ts && ts->sigfd != -1) lxc_console_sigwinch_fini(ts); err1: lxc_console_delete(&conf->console);