On 02/12/2026 22:16, Bruno Haible wrote:
Pádraig Brady wrote:
This avoids issues on misconfigured systems like with GLIBC:
   https://sourceware.org/PR35092
This unlikely case can break various assumptions that users expect.
E.g. it would trigger buffer overflows in `numfmt -d` or `paste -d`,
or mbs_endswidth (numfmt -s).  By returning an error, users can
reject the input or fall back to byte oriented processing.

I am opposed to this patch in its entirety.

glibc supports some locales that
   - are not in use since 2010, or 2015 at the latest, (because the
     move to UTF-8 locales was completed in the distros around 2010),
   - require complex processing due to a charset that does not map
     to Unicode 1:1, requiring stateful conversion in mbrtowc and wcrtomb.

These are:
   zh_HK.BIG5-HKSCS
   yi_US.CP1255
and all locales people could possibly build with the encodings
   BIG5-HKSCS, CP1255, CP1258, TCVN5712-1, TSCII.

I do not think that it is adequate to add even more complexity to our
code (in gnulib and other GNU packages) to support something that no one
has been using for the last 15 years.

This was already my opinion one or two years ago. In 2026, the current
events support this opinion even more:
   * Anyone can find vulnerabilities relatively cheaply nowadays, using
     AI tools.
   * Fixing vulnerabilities requires manpower (and adds complexity and,
     as Paul noticed in this case, can slow down the code).
   * The answer of the Linux kernel people to vulnerabilities in drivers
     for hardware that was not sold in the last 15 years is now to axe
     that driver.

So, instead of spending time (and complexity and speed) on supporting
useless locale, my proposal is to mark them as unsupported.
   1. through documentation,
   2. (optionally) through a setlocale() override that falls back to
      the "C" locale when asked to activate one of the locales mentioned
      above.

Note: I don't care whether we apply this to the EUC* and BIG5* and JOHAB
encodings as well. But GB18030 should remain supported, even though no one
uses it, simply to fulfil the checklist requirements of some companies.
Yes I agree with you mostly.

It's just that with a default install one can trigger buffer overflows
currently in numfmt and paste with these problematic locales.
They are marked in localedate/SUPPORTED in glibc after all.
Perhaps we should ask for them to be removed from there.

I'm 100% in agreement that we should not complicate the common path
for esoteric encodings where possible.

cheers,
Padraig

Reply via email to