libroot: Make sure PTHREAD_STACK_MIN is in the allowed range

This commit is contained in:
Pawel Dziepak
2013-09-16 23:23:28 +02:00
parent e69b2374f2
commit 74018092d0
@@ -12,6 +12,8 @@
#include <limits.h>
#include <stdlib.h>
#include <Debug.h>
#include <thread_defs.h>
@@ -105,6 +107,8 @@ pthread_attr_setstacksize(pthread_attr_t *_attr, size_t stacksize)
if (_attr == NULL || (attr = *_attr) == NULL)
return B_BAD_VALUE;
STATIC_ASSERT(PTHREAD_STACK_MIN >= MIN_USER_STACK_SIZE
&& PTHREAD_STACK_MIN <= MAX_USER_STACK_SIZE);
if (stacksize < PTHREAD_STACK_MIN || stacksize > MAX_USER_STACK_SIZE)
return B_BAD_VALUE;