From: GNU Libc Maintainers Date: Fri, 20 Sep 2019 19:39:03 +0000 (+0100) Subject: submitted-nptl-invalid-td X-Git-Tag: archive/raspbian/2.29-2+rpi1^2~16 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a5b48bea0402f7679972d9243e8d75aeb52b1f6f;p=glibc.git submitted-nptl-invalid-td 2010-02-27 Aurelien Jarno * pthreadP.h(INVALID_TD_P, INVALID_NOT_TERMINATED_TD_P): detect NULL pointers. Gbp-Pq: Topic any Gbp-Pq: Name submitted-nptl-invalid-td.patch --- diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 626bd4b09..a954c8c08 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -251,8 +251,8 @@ extern int __pthread_debug attribute_hidden; /* Simplified test. This will not catch all invalid descriptors but is better than nothing. And if the test triggers the thread descriptor is guaranteed to be invalid. */ -# define INVALID_TD_P(pd) __builtin_expect ((pd)->tid <= 0, 0) -# define INVALID_NOT_TERMINATED_TD_P(pd) __builtin_expect ((pd)->tid < 0, 0) +# define INVALID_TD_P(pd) __builtin_expect (!pd || ((pd)->tid <= 0), 0) +# define INVALID_NOT_TERMINATED_TD_P(pd) __builtin_expect (!pd || ((pd)->tid < 0), 0) #endif