libthread_xu: Fix checking of pthread_barrier_init()'s count argument. v4.8.1
authorSascha Wildner <saw@online.de>
Tue, 1 Aug 2017 10:43:45 +0000 (12:43 +0200)
committerSascha Wildner <saw@online.de>
Tue, 1 Aug 2017 10:43:45 +0000 (12:43 +0200)
lib/libthread_xu/thread/thr_barrier.c

index 4e2ea03..7f00ed1 100644 (file)
@@ -57,7 +57,7 @@ _pthread_barrier_init(pthread_barrier_t *barrier,
 {
        pthread_barrier_t bar;
 
-       if (barrier == NULL || count <= 0)
+       if (barrier == NULL || count == 0 || count > INT_MAX)
                return (EINVAL);
 
        bar = malloc(sizeof(struct pthread_barrier));