From: GNU Libc Maintainers Date: Sat, 27 Aug 2022 11:38:11 +0000 (+0100) Subject: submitted-nptl-invalid-td X-Git-Tag: archive/raspbian/2.34-7+rpi1~1^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e24b7f5713e6f61d2cebc20060cb8e644369c0a3;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/sysdeps/nptl/pthreadP.h b/sysdeps/nptl/pthreadP.h index b968afc4c..c62f74054 100644 --- a/sysdeps/nptl/pthreadP.h +++ b/sysdeps/nptl/pthreadP.h @@ -242,8 +242,8 @@ libc_hidden_proto (__pthread_current_priority) /* 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) extern void __pthread_unwind (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute __attribute ((__noreturn__))