chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / debian / patches / any / submitted-nptl-invalid-td.patch
1 2010-02-27  Aurelien Jarno  <aurelien@aurel32.net>
2
3         * pthreadP.h(INVALID_TD_P, INVALID_NOT_TERMINATED_TD_P): detect
4         NULL pointers.
5
6 ---
7  nptl/pthreadP.h |    4 ++--
8  1 file changed, 2 insertions(+), 2 deletions(-)
9
10 --- a/nptl/pthreadP.h
11 +++ b/nptl/pthreadP.h
12 @@ -207,8 +207,8 @@
13  /* Simplified test.  This will not catch all invalid descriptors but
14     is better than nothing.  And if the test triggers the thread
15     descriptor is guaranteed to be invalid.  */
16 -# define INVALID_TD_P(pd) __builtin_expect ((pd)->tid <= 0, 0)
17 -# define INVALID_NOT_TERMINATED_TD_P(pd) __builtin_expect ((pd)->tid < 0, 0)
18 +# define INVALID_TD_P(pd) __builtin_expect (!pd || ((pd)->tid <= 0), 0)
19 +# define INVALID_NOT_TERMINATED_TD_P(pd) __builtin_expect (!pd || ((pd)->tid < 0), 0)
20  #endif
21  
22