[PATCH] nss_files: Fix re-reading of long lines [BZ #18991]

Florian Weimer fweimer@redhat.com
Fri Sep 1 18:04:00 GMT 2017


On 09/01/2017 05:43 PM, Florian Weimer wrote:
> +      ssize_t r = __libc_readline_unlocked
> +	(stream, data->linebuffer, linebuflen);

This fixes the line skipping due to an insufficient read buffer size.

However, if the line length is sufficiently close to the buffer size, so
that it does not leave enough room for the aliases pointer array, then
we can get a very late ERANGE error in the line parser.  This will still
result in a skipped line.  I think this means that bug 18991 is not a
regression, strictly speaking.

The test case actually catches this, but only 64-bit architectures, due
to the way the buffer sizes work out.

Florian



More information about the Libc-alpha mailing list