summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authorjdolecek <jdolecek@NetBSD.org>2003-01-28 21:04:37 +0000
committerjdolecek <jdolecek@NetBSD.org>2003-01-28 21:04:37 +0000
commit5e8bddc2e792489d7cc533fdee42b02ad3781389 (patch)
treeab2f02845c7127528fd05ed62431ccb6553d4200 /lib/libpthread
parent9804cdc7fc57a4dcb102bb304e6970474bbfe813 (diff)
__sigaction14(): sanity check 'sig' before use, same way as sigaction1()
in kernel
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/pthread_sig.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libpthread/pthread_sig.c b/lib/libpthread/pthread_sig.c
index 3b441f6351e..b74f5b5215d 100644
--- a/lib/libpthread/pthread_sig.c
+++ b/lib/libpthread/pthread_sig.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_sig.c,v 1.5 2003/01/25 00:43:38 nathanw Exp $ */
+/* $NetBSD: pthread_sig.c,v 1.6 2003/01/28 21:04:37 jdolecek Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -130,6 +130,9 @@ __sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
self = pthread__self();
if (act != NULL) {
+ if (sig <= 0 || sig >= _NSIG)
+ return (EINVAL);
+
/* Save the information for our internal dispatch. */
pthread_spinlock(self, &pt_sigacts_lock);
pt_sigacts[sig] = *act;