[PATCH] Fix getting environment variables for sanitizers needs on FreeBSD
Ed Maste
emaste at freebsd.org
Mon Jun 23 07:34:52 PDT 2014
================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:325
@@ +324,3 @@
+ uptr NameLen = internal_strlen(name);
+ for (char **Env = ::environ; *Env != NULL; Env++) {
+ if (internal_strncmp(*Env, name, NameLen) == 0 && (*Env)[NameLen] == '=')
----------------
Note that ::environ may be null - see the libc implementation here:
http://svnweb.freebsd.org/base/head/lib/libc/stdlib/getenv.c?revision=253413&view=markup#l428
http://reviews.llvm.org/D4229
More information about the llvm-commits
mailing list