diff options
author | das <das@FreeBSD.org> | 2008-01-15 06:50:50 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2008-01-15 06:50:50 +0000 |
commit | c41cd4bf35f4da7e4e9e2f36779c90ddbc25640b (patch) | |
tree | b33232a651fe230bf4e3f7db42d7faa55edc3378 /lib/libc | |
parent | 24232b615d41fb5e5e7a5ee56691f4caeacdf216 (diff) | |
download | FreeBSD-src-c41cd4bf35f4da7e4e9e2f36779c90ddbc25640b.zip FreeBSD-src-c41cd4bf35f4da7e4e9e2f36779c90ddbc25640b.tar.gz |
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
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/getttyent.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c index 8249fad..efc4c9b 100644 --- a/lib/libc/gen/getttyent.c +++ b/lib/libc/gen/getttyent.c @@ -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) { |