Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses PR lib/53615



details:   https://anonhg.NetBSD.org/src/rev/989c051fe351
branches:  trunk
changeset: 433525:989c051fe351
user:      rin <rin%NetBSD.org@localhost>
date:      Tue Sep 18 22:51:00 2018 +0000

description:
PR lib/53615

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

OK roy

diffstat:

 lib/libcurses/tstp.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 94f2ba5b3e57 -r 989c051fe351 lib/libcurses/tstp.c
--- a/lib/libcurses/tstp.c      Tue Sep 18 22:46:18 2018 +0000
+++ b/lib/libcurses/tstp.c      Tue Sep 18 22:51:00 2018 +0000
@@ -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 @@
         * 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;



Home | Main Index | Thread Index | Old Index