]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
mail: add volatile in grabh()
authorLexi Winter <lexi@le-Fay.ORG>
Thu, 4 Jan 2024 22:34:58 +0000 (22:34 +0000)
committerMark Johnston <markj@FreeBSD.org>
Fri, 5 Jan 2024 02:40:53 +0000 (21:40 -0500)
commit6c951b37170f1fb2ae8b4827070743e61b6eaed2
treed5e2e933a9bcd677edecfb1f0bf908713902c5be
parent324fd7ec40439e6b3916429a69956d7acf74eb19
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
usr.bin/mail/tty.c