bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH] ansic_quote: zero mbstate when needed


From: Chet Ramey
Subject: Re: [PATCH] ansic_quote: zero mbstate when needed
Date: Mon, 15 Sep 2025 15:13:36 -0400
User-agent: Mozilla Thunderbird

On 9/14/25 1:50 AM, Grisha Levit wrote:
ansic_quote calls mbrtowc with a NULL parser state argument. This uses a
static anonymous shift state that ends up in an undefined state after an
invalid sequence. AFAICT most libcs handle UTF-8 conversions with the
static state just fine, but on Android [1] the bionic libc implementation
will, in fact, produce incorrect results if the state is reused after an
invalid sequence:

Thanks for the report. I suppose the state is technically undefined after
an invalid wide character.


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]