bug-bash
[Top][All Lists]
Advanced

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

Re: Segmentation fault in pat_subst


From: Eduardo A . Bustamante López
Subject: Re: Segmentation fault in pat_subst
Date: Tue, 23 Jul 2019 22:32:34 -0700
User-agent: Mutt/1.10.1 (2018-07-13)

On Sun, Jul 21, 2019 at 06:56:09PM -0400, Chet Ramey wrote:
(...)
> 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.

Aha! I see.

| Starting program: /tmp/bash/bash -c x=0\;\ :\ \$\{x/\#\[0�\\Z\[:\]\]\}
| 
| Breakpoint 1, match_wpattern (wstring=0x5555556c1d90 L"0", 
indices=0x5555556c1e20, wstrlen=1, wpat=0x5555556c1d00 L"[0�\\Z[:]]", mtype=1, 
sp=0x7fffffffd918, ep=0x7fffffffd910)
|     at /home/dualbus/src/gnu/bash/subst.c:4963
| 4963      if (mlen > wstrlen)
| (gdb) p mlen
| $1 = 2
| (gdb) p wstrlen
| $2 = 1

Interesting, I can see how that `mlen = 2' can cause trouble. Thank you for the 
pointer and the fix!



reply via email to

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