[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e44182cb-cfb0-4e6a-bdf7-77ef87be530e@gmx.de>
Date: Wed, 26 Nov 2025 20:34:05 +0100
From: Armin Wolf <W_Armin@....de>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: viro@...iv.linux.org.uk, brauner@...nel.org, hansg@...nel.org,
ilpo.jarvinen@...ux.intel.com, superm1@...nel.org, jack@...e.cz,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH v2 1/4] fs/nls: Fix utf16 to utf8 conversion
Am 26.11.25 um 16:18 schrieb Andy Shevchenko:
> On Tue, Nov 11, 2025 at 02:11:22PM +0100, Armin Wolf wrote:
>> Currently the function responsible for converting between utf16 and
>> utf8 strings will ignore any characters that cannot be converted. This
>> however also includes multi-byte characters that do not fit into the
>> provided string buffer.
>>
>> This can cause problems if such a multi-byte character is followed by
>> a single-byte character. In such a case the multi-byte character might
>> be ignored when the provided string buffer is too small, but the
>> single-byte character might fit and is thus still copied into the
>> resulting string.
>>
>> Fix this by stop filling the provided string buffer once a character
>> does not fit. In order to be able to do this extend utf32_to_utf8()
>> to return useful errno codes instead of -1.
> Can you also update utf8_to_utf32() to return meaningful error codes?
> Without that done we have inconsistent APIs.
>
Sure, i will send a separate patch for that.
Thanks,
Armin Wolf
Powered by blists - more mailing lists