Module Name:    src
Committed By:   rin
Date:           Tue Sep 18 22:51:00 UTC 2018

Modified Files:
        src/lib/libcurses: tstp.c

Log Message:
PR lib/53615

Before invoking a previous signal handler, make sure it is not SIG_*.
Fix potential crash with SIGWINCH.

OK roy


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/lib/libcurses/tstp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libcurses/tstp.c
diff -u src/lib/libcurses/tstp.c:1.42 src/lib/libcurses/tstp.c:1.43
--- src/lib/libcurses/tstp.c:1.42	Fri Jan  6 13:53:18 2017
+++ src/lib/libcurses/tstp.c	Tue Sep 18 22:51:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tstp.c,v 1.42 2017/01/06 13:53:18 roy Exp $	*/
+/*	$NetBSD: tstp.c,v 1.43 2018/09/18 22:51:00 rin Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)tstp.c	8.3 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: tstp.c,v 1.42 2017/01/06 13:53:18 roy Exp $");
+__RCSID("$NetBSD: tstp.c,v 1.43 2018/09/18 22:51:00 rin Exp $");
 #endif
 #endif				/* not lint */
 
@@ -150,7 +150,10 @@ __winch_signal_handler(/*ARGSUSED*/int s
 	 * If there was a previous handler, call that,
 	 * otherwise tell getch() to send KEY_RESIZE.
 	 */
-	if (owsa.sa_handler !=  NULL)
+	if (owsa.sa_handler != SIG_DFL &&
+	    owsa.sa_handler != SIG_IGN &&
+	    owsa.sa_handler != SIG_ERR &&
+	    owsa.sa_handler != SIG_HOLD)
 		owsa.sa_handler(signo);
 	else
 		_cursesi_screen->resized = 1;

Reply via email to