diff options
author | 2008-05-01 15:30:29 +0000 | |
---|---|---|
committer | 2008-05-01 15:30:29 +0000 | |
commit | e5f62524c7b08e7f6bb8724b514baabb64dda714 (patch) | |
tree | 8de288187d871ad3de44167d82f573517c0bd623 | |
parent | regen (diff) | |
download | wireguard-openbsd-e5f62524c7b08e7f6bb8724b514baabb64dda714.tar.xz wireguard-openbsd-e5f62524c7b08e7f6bb8724b514baabb64dda714.zip |
Sync hpux_sendsig() behaviour with native sendsig(): let malloc fail and
sigexit the process in this case.
-rw-r--r-- | sys/arch/hp300/hp300/hpux_machdep.c | 10 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/hpux_machdep.c | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/sys/arch/hp300/hp300/hpux_machdep.c b/sys/arch/hp300/hp300/hpux_machdep.c index e180c0a2789..74eec250d6c 100644 --- a/sys/arch/hp300/hp300/hpux_machdep.c +++ b/sys/arch/hp300/hp300/hpux_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hpux_machdep.c,v 1.21 2007/11/02 19:18:54 martin Exp $ */ +/* $OpenBSD: hpux_machdep.c,v 1.22 2008/05/01 15:30:29 miod Exp $ */ /* $NetBSD: hpux_machdep.c,v 1.19 1998/02/16 20:58:30 thorpej Exp $ */ /* @@ -419,7 +419,13 @@ hpux_sendsig(catcher, sig, mask, code, type, val) p->p_pid, sig, &oonstack, fp, &fp->hsf_sc, ft); #endif - kfp = (struct hpuxsigframe *)malloc((u_long)fsize, M_TEMP, M_WAITOK); + kfp = (struct hpuxsigframe *)malloc((u_long)fsize, M_TEMP, + M_WAITOK | M_CANFAIL); + if (kfp == NULL) { + /* Better halt the process in its track than panicing */ + sigexit(p, SIGILL); + /* NOTREACHED */ + } /* * Build the argument list for the signal handler. diff --git a/sys/arch/mvme68k/mvme68k/hpux_machdep.c b/sys/arch/mvme68k/mvme68k/hpux_machdep.c index b454ace3c01..2c10d677863 100644 --- a/sys/arch/mvme68k/mvme68k/hpux_machdep.c +++ b/sys/arch/mvme68k/mvme68k/hpux_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hpux_machdep.c,v 1.15 2007/11/02 19:18:54 martin Exp $ */ +/* $OpenBSD: hpux_machdep.c,v 1.16 2008/05/01 15:30:30 miod Exp $ */ /* $NetBSD: hpux_machdep.c,v 1.9 1997/03/16 10:00:45 thorpej Exp $ */ /* @@ -458,7 +458,13 @@ hpux_sendsig(catcher, sig, mask, code, type, val) p->p_pid, sig, &oonstack, fp, &fp->sf_sc, ft); #endif - kfp = (struct hpuxsigframe *)malloc((u_long)fsize, M_TEMP, M_WAITOK); + kfp = (struct hpuxsigframe *)malloc((u_long)fsize, M_TEMP, + M_WAITOK | M_CANFAIL); + if (kfp == NULL) { + /* Better halt the process in its track than panicing */ + sigexit(p, SIGILL); + /* NOTREACHED */ + } /* * Build the argument list for the signal handler. |