Even though alarm(0) is called, another process could still send a
SIGALRM signal to the login process, which could trigger a use after
free for a tiny amount of time.
Not able to reproduce without adding a proper sleep.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
{
struct sigaction sa, oldsa_hup, oldsa_term;
- signal(SIGALRM, SIG_DFL);
signal(SIGQUIT, SIG_DFL);
signal(SIGTSTP, SIG_IGN);
/* committed to login -- turn off timeout */
alarm((unsigned int)0);
+ signal(SIGALRM, SIG_DFL);
free(timeout_msg);
timeout_msg = NULL;