diff options
author | pfg <pfg@FreeBSD.org> | 2017-08-01 01:23:55 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2017-08-01 01:23:55 +0000 |
commit | c1d6a4e9d2c040ce00f5eba80c7c5e1a9c7b6a5d (patch) | |
tree | 7bb345500fce9ca4ad902859f86b0f7fb9b8ab44 /lib | |
parent | efa008caeba52cf5e98c22c35d03b2d1fe9a1b6a (diff) | |
download | FreeBSD-src-c1d6a4e9d2c040ce00f5eba80c7c5e1a9c7b6a5d.zip FreeBSD-src-c1d6a4e9d2c040ce00f5eba80c7c5e1a9c7b6a5d.tar.gz |
MFC r320990, r321011:
libthr: Avoid checking for negative values in usigned count.
Check for overflow instead.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libthr/thread/thr_barrier.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_barrier.c b/lib/libthr/thread/thr_barrier.c index dd8f48e..2c47f13 100644 --- a/lib/libthr/thread/thr_barrier.c +++ b/lib/libthr/thread/thr_barrier.c @@ -100,7 +100,7 @@ _pthread_barrier_init(pthread_barrier_t *barrier, pthread_barrier_t bar; int pshared; - if (barrier == NULL || count <= 0) + if (barrier == NULL || count == 0 || count > INT_MAX) return (EINVAL); if (attr == NULL || *attr == NULL || |