Commit e4e7d59d by Sven Wegener Committed by Daniel Lezcano

use correct number of ttys during setup

commit 985d15b1 "fix fdleak and errors in lxc_create_tty()" created a zero-sized malloc(), causing memory corruption. use config->tty like all the other code does. Signed-off-by: 's avatarSven Wegener <sven.wegener@stealer.net> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 6ab9ab6d
...@@ -999,7 +999,7 @@ int lxc_create_tty(const char *name, struct lxc_conf *conf) ...@@ -999,7 +999,7 @@ int lxc_create_tty(const char *name, struct lxc_conf *conf)
return 0; return 0;
tty_info->pty_info = tty_info->pty_info =
malloc(sizeof(*tty_info->pty_info)*tty_info->nbtty); malloc(sizeof(*tty_info->pty_info)*conf->tty);
if (!tty_info->pty_info) { if (!tty_info->pty_info) {
SYSERROR("failed to allocate pty_info"); SYSERROR("failed to allocate pty_info");
return -1; return -1;
......
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