[Bug 15871] [busybox 1.36.1] use-after-free in awk

bugzilla at busybox.net bugzilla at busybox.net
Tue May 21 15:10:20 UTC 2024


https://bugs.busybox.net/show_bug.cgi?id=15871

--- Comment #6 from Natanael Copa <ncopa at alpinelinux.org> ---
(In reply to Natanael Copa from comment #5)

The commit that "fixes" it also introduces a regression.

  awk 'BEGIN { a = 0 ? \"yes\": \"no\"; print a }'

Prints '0' instead of 'no'. But that is a different issue.

I have a smaller reproducer for the use-after-free:

```
function f1(v) {
        return v
}

function f2(a)
{
        return f1(a) -= 0
}

function f3(a)
{
        return missingfunc(a)
}

BEGIN {
        f2() || f3()
}
```


Or:
awk 'function f1(v) { return v } function f2(a) { return f1(a) -= 0 } function
f3(a) { return missingfunc(a) } BEGIN { f2() || f3() }'

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list