Thrd_join function from libstdthreads seg faults when second parameter res is passed as NULL. The function in thrd.c writes to res without null check. C11 std specifies the parameter can be null.
Created attachment 153532 [details] Check for NULL. Are you fine with the patch attached ? Can you test it ?
Comment on attachment 153532 [details] Check for NULL. Patch is good. Tested. Works fine.
A commit references this bug: Author: kib Date: Thu Feb 26 09:42:04 UTC 2015 New revision: 279318 URL: https://svnweb.freebsd.org/changeset/base/279318 Log: 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 Changes: head/lib/libstdthreads/thrd.c