[PATCH] D47960: [asan, myriad] Support environment variables
Aleksey Shlyapnikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 11 11:31:38 PDT 2018
alekseyshl added inline comments.
================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_rtems.cc:257
+ uptr name_len = internal_strlen(name);
+ uptr end = env_len - name_len - 2;
+ uptr i = 0;
----------------
What if name_len > env_len - 2?
================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_rtems.cc:261
+ if (internal_strncmp(&env[i], name, name_len) == 0 &&
+ env[i + name_len] == '=')
+ return &env[i + name_len + 1];
----------------
name == "" and env="=x\0" will work and return "x", but maybe it's not that a bad thing.
Repository:
rL LLVM
https://reviews.llvm.org/D47960
More information about the llvm-commits
mailing list