From baf95a5aefe885ef8a675759c63d43649d312ec6 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 28 Aug 2018 18:12:17 -0400 Subject: [PATCH] reject invalid arguments to pthread_barrierattr_setpshared this is a POSIX requirement. --- src/thread/pthread_barrierattr_setpshared.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/thread/pthread_barrierattr_setpshared.c b/src/thread/pthread_barrierattr_setpshared.c index b391461e..c2d2929d 100644 --- a/src/thread/pthread_barrierattr_setpshared.c +++ b/src/thread/pthread_barrierattr_setpshared.c @@ -2,6 +2,7 @@ int pthread_barrierattr_setpshared(pthread_barrierattr_t *a, int pshared) { + if (pshared > 1U) return EINVAL; a->__attr = pshared ? INT_MIN : 0; return 0; } -- 2.25.1