[Top][All Lists]

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

Re: Segmentation fault in pat_subst

From: Chet Ramey
Subject: Re: Segmentation fault in pat_subst
Date: Sun, 21 Jul 2019 18:56:09 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 7/20/19 6:23 PM, Eduardo A. Bustamante López wrote:
> Bash `devel' crashes under the following circumstances:
> | dualbus@system76-pc:/tmp/build-bash-devel$ CFLAGS='-O0 -ggdb' 
> ~/src/gnu/bash/configure --with-bash-malloc
> | (...)
> | dualbus@system76-pc:/tmp/build-bash-devel$ make -j$(nproc)
> | (...)
> | dualbus@system76-pc:/tmp/build-bash-devel$ ./bash -c $'x=0; : 
> ${x/#[0\xef\xbf\xbd\\Z[:]]}'
> | Segmentation fault (core dumped)

> I have been looking around but I don't understand what's going on. I can see
> that the value of `str' comes from `e', which in turn comes from
> `match_pattern', but it's not clear to me why this is happening.

Thanks for the report. Look at match_wpattern and consider what happens if
wmatchlen returns something longer than the string length. It will be fixed
for the next devel branch push.


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