[sanitizer] Mark before deref in PosixSpawnImpl
authorTamir Duberstein <tamird@google.com>
Wed, 3 Nov 2021 17:16:20 +0000 (10:16 -0700)
committerHaowei Wu <haowei@google.com>
Wed, 3 Nov 2021 17:18:06 +0000 (10:18 -0700)
commit33d9b7b4b26d56b9cdc479bfd444e448d61fa978
treecb85f98458334836db18909d6a6fe9dea134c0c5
parentf79e65e61fafedd439cbc120b2461fab831127f5
[sanitizer] Mark before deref in PosixSpawnImpl

Read each pointer in the argv and envp arrays before dereferencing
it; this correctly marks an error when these pointers point into
memory that has been freed.

Differential Revision: https://reviews.llvm.org/D113046
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc