From: GNU Libc Maintainers Date: Tue, 15 Mar 2022 22:48:49 +0000 (+0000) Subject: submitted-nptl-invalid-td X-Git-Tag: archive/raspbian/2.28-10+rpi1+deb10u1^2~13 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e2e8cbb55483964a45db8aedcfa28d8cd4a3a953;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 19efe1e35..d8ea91372 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -246,8 +246,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