summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_cond.c
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>1999-08-19 23:06:11 +0000
committeralfred <alfred@FreeBSD.org>1999-08-19 23:06:11 +0000
commit557b906ef8a8572a4a3828011b21ce414ce2e283 (patch)
tree0ec3230edcd09a8395fca2f7d9285598e2025c07 /lib/libpthread/thread/thr_cond.c
parent0b6fbc2a5b83ef6eb4b1a5f56ab141146e1d09cc (diff)
downloadFreeBSD-src-557b906ef8a8572a4a3828011b21ce414ce2e283.zip
FreeBSD-src-557b906ef8a8572a4a3828011b21ce414ce2e283.tar.gz
Sanity check time structures passed in, return EINVAL like the system
calls do to avoid corrupting the thread library's concept of wakeup time. PR: kern/12141 Reviewed by: deischen, eivind
Diffstat (limited to 'lib/libpthread/thread/thr_cond.c')
-rw-r--r--lib/libpthread/thread/thr_cond.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_cond.c b/lib/libpthread/thread/thr_cond.c
index bacfb72..4d52c63 100644
--- a/lib/libpthread/thread/thr_cond.c
+++ b/lib/libpthread/thread/thr_cond.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: uthread_cond.c,v 1.15 1999/06/20 08:28:13 jb Exp $
*/
#include <stdlib.h>
#include <errno.h>
@@ -261,6 +261,10 @@ pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex,
int rval = 0;
int status;
+ if (abstime->tv_sec < 0 ||
+ abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
+ return (EINVAL);
+
if (cond == NULL)
rval = EINVAL;
OpenPOWER on IntegriCloud