From: GNU Libc Maintainers Date: Sun, 19 Sep 2021 18:46:59 +0000 (+0100) Subject: submitted-nptl-invalid-td X-Git-Tag: archive/raspbian/2.32-4+rpi1~1^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=dc0b1cbff95bc44e0a4f8d67f201c5e0a3527ee7;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 6f94d6be3..e32c96269 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -255,8 +255,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