https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223165

            Bug ID: 223165
           Summary: Crash with pthread_condattr_destroy(NULL) on
                    freebsd-11
           Product: Base System
           Version: 11.0-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: rajendra...@gmail.com

Below program crashes on FreeBSD-11.

$ cat test.c
#include <pthread.h>
int main(int argc, char *argv[]) {
        pthread_condattr_destroy(NULL);
        return 0;
}
$ clang -o test test.c -lpthread
test.c:3:31: warning: null passed to a callee that requires a non-null argument
[-Wnonnull]
        pthread_condattr_destroy(NULL);
                                 ~~~~^
1 warning generated.

syrajendra@[bm64-fbsd11] # ./test
Segmentation fault (core dumped)


The "pthread_condattr_destroy" has a argument which has _Nonnull quilifier but
the function implementation properly handles the NULL value by returning
"EINVAL" if argument is NULL.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to