Bug in busybox sed - this one is real

Denys Vlasenko vda.linux at googlemail.com
Thu Jun 7 14:37:17 UTC 2012


On Wed, Jun 6, 2012 at 2:24 AM, Rich Felker <dalias at aerifal.cx> wrote:
> On Mon, Jun 04, 2012 at 02:56:15PM +0200, Denys Vlasenko wrote:
>> On Sun, Jun 3, 2012 at 3:54 PM, Rich Felker <dalias at aerifal.cx> wrote:
>> > Ping. Anybody looked at this? I filed it as bug # 5246.
>>
>> fixed in git:
>>
>> commit 21f6fbf545e7fa58f0eaa444001a9d25bc37c4eb
>> Author: Denys Vlasenko <vda.linux at googlemail.com>
>> Date:   Mon Jun 4 14:44:47 2012 +0200
>>
>>     sed: fix zero chars match/replace
>
> The fix broke it worse:
>
> $ sed 's/\(["`$\\]\)/\\\1/g' << "EOF"
> {\"\1\"
> EOF
> {\\\"\\1\\\"
> $ busybox sed 's/\(["`$\\]\)/\\\1/g' << "EOF"
> {\"\1\"
> EOF
> {\\1\\
>
> Previous version of busybox sed handled this case fine.

Indeed, null match code falsely triggers here.
Fixed in git, please try...
-- 
vda


More information about the busybox mailing list