[PATCH] D112998: [sanitizer_common] Fix readlink error handling in sanitizer_procmaps_solaris.cpp
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 2 10:57:45 PDT 2021
vitalybuka added inline comments.
================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp:58
xmapentry->pr_mapname);
- internal_readlink(proc_path, segment->filename, segment->filename_size);
+ ssize_t sz = internal_readlink(proc_path, segment->filename,
+ segment->filename_size - 1);
----------------
vitalybuka wrote:
> Can you check if sanitizer_common/tests/sanitizer_procmaps_test.cc can be enabled for Solaris and does it trigger this error?
Would you like to fix usage of internal_readlink in ReadBinaryName?
it's called only for zero-initialized global buffer so, there is very low probability to hit error, but it's incorrect in general.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112998/new/
https://reviews.llvm.org/D112998
More information about the llvm-commits
mailing list