From: Sven Wegener Date: Thu, 26 Nov 2009 15:46:23 +0000 (+0100) Subject: use correct number of ttys during setup X-Git-Tag: lxc-0.6.5~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e7d59db88478186188024c78f76066dad1e733;p=thirdparty%2Flxc.git use correct number of ttys during setup commit 985d15b106c8959ff130ba5425c2abbe36dc2cca "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: Sven Wegener Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 0ce51aa6a..81bc470f6 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -999,7 +999,7 @@ int lxc_create_tty(const char *name, struct lxc_conf *conf) return 0; 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) { SYSERROR("failed to allocate pty_info"); return -1;