bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH] ASS_NOEVAL for BASHOPTS and SHELLOPTS


From: Chet Ramey
Subject: Re: [PATCH] ASS_NOEVAL for BASHOPTS and SHELLOPTS
Date: Tue, 13 Feb 2024 11:02:16 -0500
User-agent: Mozilla Thunderbird

On 2/7/24 1:43 AM, Grisha Levit wrote:
(Prompted by the report from Emanuele Torre in [1])

The value of currently_executing_command is garbage when there is an error
during assignment when popping the variable context:

     $ bash -c 'declare -i SHELLOPTS; f() { local -; set -f; }; f' |& cat -v
     bash: line 1: M-`^WM-R^N^\{: braceexpand:hashall:interactive-comment...

     $ bash-asan -c 'declare -i SHELLOPTS; f() { local -; set -f; }; f'
     SUMMARY: AddressSanitizer: heap-use-after-free execute_cmd.c:399 in
     executing_line_number

I fixed the underlying issue: assigning a variable to something you're
going to unwind-protect without unwind-protecting the variable.


I'm not sure that allowing the integer attribute to be changed really makes
sense for readonly variables
No one responded when I asked the question here:

https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00188.html

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