1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

trap: fix use after free (#446)

This commit adds a fix for the trap command, backported from a fork
of ksh2020: 2033375f

src/cmd/ksh93/sh/jobs.c: job_chldtrap():
- Fixed a use after free bug in the for loop. The string pointed to
  by sh.st.trapcom[SIGCHLD] may be freed from memory after
  sh_trap(), so it must be reobtained each time sh_trap() is called
  from within the for loop.
This commit is contained in:
Johnothan King 2022-02-04 18:29:23 -08:00 committed by Martijn Dekker
parent 8e72608c1c
commit fb696ecfae
4 changed files with 14 additions and 5 deletions

5
NEWS
View file

@ -9,6 +9,11 @@ Any uppercase BUG_* names are modernish shell bug IDs.
values. Previously, arithmetic $((var=1)) or conditional ${var:=value}
assignments were not exported even with allexport on.
- Fixed a memory leak that could occur when using traps.
- Fixed a use after free issue that could occur when modifying or setting
a SIGCHLD trap.
2022-02-01:
- Upon invocation, the interactive shell no longer leaves the user without