onetrueawk / awk

One true awk
Other
1.98k stars 159 forks source link

Prevent double-free when y is in array t #182

Closed RSilicon closed 12 months ago

RSilicon commented 1 year ago

The code already accounts for when y is in frp->args, but not when it is in frp->args->csub. This PR changes that by adding a function that frees while checking to see if y was found in the array and subsequently freed.

plan9 commented 12 months ago

we will not be introducing new code at this point. we may revisit this issue.

millert commented 11 months ago

This is still an issue and results in a use-after-free under both valgrind and -fsanitize=address when awk is given the following input from T.misc:

BEGIN { unireghf() }
function unireghf(hfeed) { hfeed[1] = 0 }