[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH: bash-5.0.0(2)-alpha] fix a bug that "bind -r" sometimes causes a
[PATCH: bash-5.0.0(2)-alpha] fix a bug that "bind -r" sometimes causes a segmentation fault
Mon, 19 Mar 2018 17:52:02 +0900
I used the following latest commit from the devel branch.
Author: Chet Ramey <address@hidden>
Date: Mon Mar 12 08:10:29 2018 -0400
commit bash-20180309 snapshot
At the line lib/readline/bind.c:376, an uninitialized variable `ic'
is used to assign a value to the variable `prevkey'. This assignment
to `prevkey' should be later than the assignment to `ic'. This causes
segmentation faults in Bash of the devel branch. There is no such
problem in Bash 4.4.
I noticed this bug in the following reduced case causing the
segmentation fault, but it should depend on environments because
accessing uninitialized variables generally results in undefined
$ bash-5.0.0 --norc
$ bind -r '\C-j'
$ bind -r `\C-m`
I attach a patch file.
Description: Binary data
- [PATCH: bash-5.0.0(2)-alpha] fix a bug that "bind -r" sometimes causes a segmentation fault,
Koichi Murase <=