Fix array bounds violation when pty allocation fails.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 20 Jul 2013 15:33:00 +0000 (08:33 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 20 Jul 2013 15:33:00 +0000 (08:33 -0700)
* configure.ac (PTY_TTY_NAME_SPRINTF): Use PTY_NAME_SIZE,
not sizeof pty_name, since pty_name is now a pointer to the array.
* src/process.c (PTY_NAME_SIZE): New constant.
(pty_name): Remove static variable; it's now auto.
(allocate_pty): Define even if !HAVE_PTYS; that's simpler.
Take pty_name as an arg rather than using a static variable.
All callers changed.
(create_process): Recover pty_flag from process, not from volatile local.
(create_pty): Stay inside array even when pty allocation fails.
(Fmake_serial_process): Omit unnecessary initializaiton of pty_flag.


No differences found