Re: [PATCH v5] man/man7/pathname.7: Add file documenting format of pathnames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jason, Florian,

On Sun, Jan 19, 2025 at 08:17:46AM -0500, Jason Yundt wrote:
> > It seems you're passing a non-terminated string, and thus it's producing
> > a non-terminated string.  Why don't you pass a null-terminated string?
> > 
> > That is, inbytesleft should include be the length + 1.
> 
> Here’re my concern: iconv(3) is going to see the final element of
> utf32_pathname and interpret it as a U+0000 null character.  In some
> character encodings, U+0000 null is encoded as a single null byte.  In
> other character encodings, U+0000 null is encoded as something other
> than a single null byte.  For example, in Modified UTF-8, U+0000 null is
> encoded as the bytes C0 80.  Is there any guarantee that
> nl_langinfo(CODESET) will return a character encoding where U+0000 is
> represented as a single null byte?

Hmmm.

Florian, do you know this?

You could maybe overcommit, that is, provide space for 4 bytes, just in
case.  But I would prefer to not need to do that, so if we can get a
guarantee that the terminator will be a single null byte, it would be
much better.


Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux