bug-bash
[Top][All Lists]
Advanced

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

Re: Segfault assigning to nameref with bad array subscript


From: Chet Ramey
Subject: Re: Segfault assigning to nameref with bad array subscript
Date: Sun, 1 May 2016 19:54:08 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.0

On 4/27/16 2:45 AM, Grisha Levit wrote:
> Any of the following will crash bash:
> 
> declare -n ref=a[*]; ref=
> declare -n ref=a[@]; ref=
> declare -n ref=a[-1]; a=(); ref=
> 
> declare -A A; declare -n ref='A[$unset]'; ref=
> 
> They all produce "bad array subscript" errors so could be caught.

Thanks for the report.  This was an easy fix, and the fix will be in
bash-4.4.

Chet

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



reply via email to

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