mirror of
git://git.musl-libc.org/musl
synced 2025-02-22 05:46:49 +00:00
enforce stack size min in pthread_attr_setstacksize
This commit is contained in:
parent
6fc5fdbdc7
commit
8c967b9386
@ -2,7 +2,7 @@
|
||||
|
||||
int pthread_attr_setstacksize(pthread_attr_t *a, size_t size)
|
||||
{
|
||||
if (size-PAGE_SIZE > SIZE_MAX/4) return EINVAL;
|
||||
if (size-PTHREAD_STACK_MIN > SIZE_MAX/4) return EINVAL;
|
||||
a->_a_stacksize = size - DEFAULT_STACK_SIZE;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user