Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Re: patch: tsort has no business handling NUL bytes
To:
tech@openbsd.org
Date:
Wed, 24 Jun 2026 13:38:01 +0200

Download raw body.

Thread
On Wed, Jun 24, 2026 at 01:26:25PM +0200, Jeremie Courreges-Anglas wrote:
> On Wed, Jun 24, 2026 at 01:18:48PM +0200, Marc Espie wrote:
> > The Opengroup text says:
> > file
> >     A pathname of a text file to order. If no file operand is given, the standard input shall be used.
> > 
> > Keyword: text
> > 
> > a NUL byte has no place in a text file.
> 
> I agree that we shouldn't attempt to support NUL bytes.  Pretending
> that we do so in one place bears the question whether the rest of the
> code is safe, and it most probably isn't.  Actually, read_hints()
> right below has the same "issue".
> 
> Here's the diff which I hadn't sent yet because it didn't go through a
> bulk build.  Sooon...  I didn't bother printing the file name because
> of stdin handling.

I'd add the name to the errx like in the other err[x] in the same
function.

ok tb