freebsd-skq/libexec/getty
se 4a8a970d5e Fix potential buffer overflow and undefined behavior.
The buffer allocated in read_chat() could be 1 element too short, if the
chatstr parameter passed in is 1 or 3 charachters long (e.g. "a" or "a b").
The allocation of the pointer array does not account for the terminating
NULL pointer in that case.

Overlapping source and destination strings are undefined in strcpy().
Instead of moving a string to the left by one character just increment the
char pointer before it is assigned to the results array.

MFC after:	2 weeks
2019-01-26 20:43:28 +00:00
..
chat.c
extern.h
getty.8
gettytab
gettytab.5
gettytab.h
init.c
main.c
Makefile
Makefile.depend
pathnames.h
subr.c
ttys.5