Fix array bounds violation when pty allocation fails.
commit6496aec9e948e0e5e6646aff408391d78f3516cc
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 20 Jul 2013 15:33:00 +0000 (20 08:33 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 20 Jul 2013 15:33:00 +0000 (20 08:33 -0700)
treed3e3afc92e5189ef1b1a8d2814965f003c13f96f
parentb2a069c2f80cb2fdd683f5e044642b058c4d2326
Fix array bounds violation when pty allocation fails.

* 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.
ChangeLog
configure.ac
src/ChangeLog
src/process.c