[Top][All Lists]

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

Re: Corrupted multibyte characters in command substitutions

From: Chet Ramey
Subject: Re: Corrupted multibyte characters in command substitutions
Date: Thu, 6 Jan 2022 17:03:47 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.1

On 1/3/22 6:02 PM, Ángel wrote:

Or, an even simpler one (assuming a utf-8 locale, like almost everyone uses 
these days):
$ printf "%511s\xc3\xa4" | ./bash -c 'a="$(echo a)"; d=$(cat); echo "$d"' | sed 
's/^ *//'

where it should have output:

Even with this reproducer, I was unable to get it to happen on RHEL7 with
an unpatched bash-5.1 (en_US.UTF-8, de_DE.UTF-8). I was never able to get
it to happen using Frank's test case. It doesn't seem easy to reproduce.

As for patching the systems, I think this deserves being patched even
on stable distros. Albeit I would prefer that Chet released an official
patch first.

I did. The question is what the distros do with it. The example Frank
used --  Debian stable -- was 8 patches behind when he sent the report, and
is 12 behind now. Whether or not we think patches `deserve' to be applied
by the distros doesn't seem to count for much.


``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/

reply via email to

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