This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] nss_files: Fix re-reading of long lines [BZ #18991]
- From: Florian Weimer <fweimer at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 1 Sep 2017 20:04:04 +0200
- Subject: Re: [PATCH] nss_files: Fix re-reading of long lines [BZ #18991]
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A423EC057FA1
- References: <20170901154353.52A27439942E3@oldenburg.str.redhat.com>
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