-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
combining alarm and IFS caused segfault (rhbz#1176670)
The undocumented alarm builtin executes actions unsafely so that 'read' with an IFS assignment crashed when an alarm was triggered. This applies an edited version of a Red Hat patch: https://src.fedoraproject.org/rpms/ksh/blob/642af4d6/f/ksh-20120801-alarmifs.patch Prior discussion: https://bugzilla.redhat.com/1176670 src/cmd/ksh93/bltins/alarm.c: - Add a TODO note based on dgk's 2014 email cited in the RH bug. - When executing the trap function, save and restore the IFS table. src/cmd/ksh93/sh/init.c: get_ifs(): - Remove now-unnecessary SHOPT_MULTIBYTE preprocessor directives as 8477d2c lets the compiler optimise out multibyte code if needed. - Initialise the 0 position of the IFS table to S_EOF. This corresponds with the static state tables in data/lexstates.c. src/cmd/ksh93/tests/builtins.sh: - Crash test.
- Loading branch information
Showing
3 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters