bug-bash
[Top][All Lists]
Advanced

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

Re: eval '<$(;)' causes Segmentation Fault


From: Lawrence Velázquez
Subject: Re: eval '<$(;)' causes Segmentation Fault
Date: Sun, 25 Aug 2024 22:54:31 -0400

On Sun, Aug 25, 2024, at 6:24 PM, youheng.lue@gmail.com wrote:
> Bash Version: 5.1
>
> Patch Level: 16

Note that this version of bash is outdated and will not receive
further updates.  The current release is 5.2.


>         All the following scripts can create a Segmentation Fault
>
>         eval '<$[;]'
>         eval '<${;}'
>         eval '<$[|]'

These still cause the current devel branch to segfault, but (at
least for me, on macOS) only when invoked via argument, as OP
directed.  For example, reading the scripts via stdin avoids the
segfault.

        % cat /tmp/poc.bash
        eval '<$[;]'
        % ./bash /tmp/poc.bash
        /tmp/poc.bash: line 1: ;: arithmetic syntax error: operand expected 
(error token is ";")
        /tmp/poc.bash: line 1: 55480 Segmentation fault: 11
        % ./bash </tmp/poc.bash
        ./bash: line 1: ;: arithmetic syntax error: operand expected (error 
token is ";")


>         eval '<$(;)'
>         eval '<$(|)'

Current devel doesn't segfault with these.  Maybe because of the
comsub parser rewrite?


>         eval '<${|}'

Current devel doesn't segfault with this, either.


-- 
vq



reply via email to

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