submitted-nptl-invalid-td
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Thu, 17 Mar 2022 21:37:00 +0000 (21:37 +0000)
committerAurelien Jarno <aurel32@debian.org>
Thu, 17 Mar 2022 21:37:00 +0000 (21:37 +0000)
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 7e0ab8ef423c27e2f093e90c5652a044316292ea..4ef109ac6b7ee475aa1ff409e1f65e33f4f16285 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