submitted-nptl-invalid-td
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Fri, 20 Sep 2019 19:39:03 +0000 (20:39 +0100)
committerAurelien Jarno <aurel32@debian.org>
Fri, 20 Sep 2019 19:39:03 +0000 (20:39 +0100)
2010-02-27  Aurelien Jarno  <aurelien@aurel32.net>

* 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

nptl/pthreadP.h

index 626bd4b096a1da0cab827f52bd99c4d4a0b52709..a954c8c08043c567dfe9ce5e46fe7920d0885c6f 100644 (file)
@@ -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