[Top][All Lists]

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

Re: (( arr[${var@Q}] )) makes the shell crash in bash-5.2

From: Chet Ramey
Subject: Re: (( arr[${var@Q}] )) makes the shell crash in bash-5.2
Date: Fri, 30 Sep 2022 09:14:32 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.0

On 9/30/22 7:15 AM, Koichi Murase wrote:
2022年9月30日(金) 19:50 Koichi Murase <myoga.murase@gmail.com>:
2022年9月30日(金) 19:37 Emanuele Torre <torreemanuele6@gmail.com>:
In bash-5.2, using the ${parameter@Q} parameter expansion with an unset
parameter, in an array subscript, in an arithmetic context, causes a
segmentation fault.

It seems even ((y[$a])) in arithmetic contexts causes a segfault:

I attach a patch [0001-subst-handle-null-substring.patch].

Thanks for the diagnosis and patch.


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