Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
io_prompt(): fix use-after-free in PS2 handling (re: 2322f93)
If a PS2.get discipline function is set (like in our shipped 'bin/package use' environment), then the value of PS2 is pushed on the stack (see nvdisc.c:429). So, restoring the stack state after getting the PS2 value may free the space that contains the value and a use-after-free may occur when calling sfputr to output it. src/cmd/ksh93/sh/io.c: io_prompt(): - Output the obtained value of PS2 before restoring the stack. - Get rid of the ugly gotos.
- Loading branch information