diff options
author | Ajay Dudani <adudani@quicinc.com> | 2009-10-12 00:53:07 -0700 |
---|---|---|
committer | Ajay Dudani <adudani@quicinc.com> | 2009-10-12 10:12:00 -0700 |
commit | 0e94a29e3cde77f0bb63f3670a81d80c484a5a51 (patch) | |
tree | 65fe2f95847cc1ea3b53a430200966fb997e1ff5 | |
parent | 5cef9a85b8763e1ea00ae65256e20d1377d5d27f (diff) | |
download | bionic-0e94a29e3cde77f0bb63f3670a81d80c484a5a51.zip bionic-0e94a29e3cde77f0bb63f3670a81d80c484a5a51.tar.gz bionic-0e94a29e3cde77f0bb63f3670a81d80c484a5a51.tar.bz2 |
bionic: Add null check before dereferencing thread data structure
While this is not a fix for the CR, this may prevent native crash
as seen in CR 212158
-rw-r--r-- | libc/bionic/pthread.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c index ec3c459..f2d9cb3 100644 --- a/libc/bionic/pthread.c +++ b/libc/bionic/pthread.c @@ -1538,7 +1538,11 @@ int pthread_kill(pthread_t tid, int sig) int old_errno = errno; pthread_internal_t * thread = (pthread_internal_t *)tid; + if (!thread) + return ESRCH; + ret = tkill(thread->kernel_id, sig); + if (ret < 0) { ret = errno; errno = old_errno; |