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