mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-07 00:50:50 +00:00
Check that the pointer to the thread return value is not NULL before
dereferencing. NULL is allowed by C11 and must be handled. Reported and tested by: Vineela <vineela_17@yahoo.com> PR: 198038 Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
12fe6c356b
commit
3b2cc6d44e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=279318
|
@ -108,7 +108,8 @@ thrd_join(thrd_t thr, int *res)
|
|||
|
||||
if (pthread_join(thr, &value_ptr) != 0)
|
||||
return (thrd_error);
|
||||
*res = (intptr_t)value_ptr;
|
||||
if (res != NULL)
|
||||
*res = (intptr_t)value_ptr;
|
||||
return (thrd_success);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue