Unverified Commit a836df04 by Scott Parlane Committed by Christian Brauner

avoid a NULL pointer dereference in lxc-attach

Seems to appear when stderr is a terminal and not stdin or stdout. Signed-off-by: 's avatarScott Parlane <scott.parlane@alliedtelesis.co.nz>
parent 8c23afc3
...@@ -1384,11 +1384,14 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function, ...@@ -1384,11 +1384,14 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
if (pid == 0) { if (pid == 0) {
if (options->attach_flags & LXC_ATTACH_TERMINAL) { if (options->attach_flags & LXC_ATTACH_TERMINAL) {
ret = pthread_sigmask(SIG_SETMASK, if (terminal.tty_state)
&terminal.tty_state->oldmask, NULL); {
if (ret < 0) { ret = pthread_sigmask(SIG_SETMASK,
SYSERROR("Failed to reset signal mask"); &terminal.tty_state->oldmask, NULL);
_exit(EXIT_FAILURE); if (ret < 0) {
SYSERROR("Failed to reset signal mask");
_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