[Sanitizers] Check pthread_setcancel{state|type} interceptor arguments for != nullptr.
authorAlex Shlyapnikov <alekseys@google.com>
Mon, 6 Nov 2017 17:43:28 +0000 (17:43 +0000)
committerAlex Shlyapnikov <alekseys@google.com>
Mon, 6 Nov 2017 17:43:28 +0000 (17:43 +0000)
commitadbf476a8806cdc62bde5e182033cf72e7252798
tree0905ab03e2f29794b4589d5bc6067056e204a018
parent06aa2aff7bb7409cd09598b41e6cda830bad0f01
[Sanitizers] Check pthread_setcancel{state|type} interceptor arguments for != nullptr.

Summary:
According to man, pthread_setcancelstate's oldstate and
pthread_setcanceltype's oldtype parameters can be nullptr.
Check these parameters for != nullptr before attempting to
access their shadow memory.

Reviewers: dvyukov

Subscribers: kubamracek, llvm-commits

Differential Revision: https://reviews.llvm.org/D39626

llvm-svn: 317494
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc