In getttyent(3), if /etc/ttys doesn't end in a newline, don't
freak out and keep trying to expand the buffer until realloc() fails. PR: 114398
This commit is contained in:
parent
eee55ebda9
commit
00a32d0ca9
@ -97,7 +97,7 @@ getttyent()
|
||||
return (NULL);
|
||||
}
|
||||
/* extend buffer if line was too big, and retry */
|
||||
while (!index(p, '\n')) {
|
||||
while (!index(p, '\n') && !feof(tf)) {
|
||||
i = strlen(p);
|
||||
lbsize += MALLOCCHUNK;
|
||||
if ((p = realloc(line, lbsize)) == NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user