mail: add volatile in grabh()
setjmp() requires that any stack variables modified between the setjmp
call and the longjmp() must be volatile. This means that 'saveint' in
grabh() must be volatile, since it's modified after the setjmp().
Otherwise, the signal handler is not properly restored, resulting in a
crash (SIGBUS) if ^C is typed twice while composing.
PR: 276119
Reported by: Christopher Davidson <christopher.davidson@gmail.com>
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/993
(cherry picked from commit 6c951b3717)
This commit is contained in:
parent
6a75d3b3fb
commit
f2ad8d3a13
1 changed files with 1 additions and 1 deletions
|
|
@ -60,7 +60,7 @@ int
|
|||
grabh(struct header *hp, int gflags)
|
||||
{
|
||||
struct termios ttybuf;
|
||||
sig_t saveint;
|
||||
volatile sig_t saveint;
|
||||
sig_t savetstp;
|
||||
sig_t savettou;
|
||||
sig_t savettin;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue