Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Scope variables to the subshell before running their discipline
The crash in tilde.sh under ASan occurs because .sh.tilde is given its discipline function before it's scoped to the subshell it's inside of. This causes sh_subshell to free it via an nv_delete call, but due to the improper scoping .sh.tilde in the parent function now has an np->nvfun which points to freed memory. To avoid this, create a scope for the target variable when inside of a subshell to ensure the subshell's discipline function doesn't leak out and cause a use after free.
- Loading branch information