[compiler-rt] 9fe0d67 - [sanitizer] Check kArgVMax in SymbolizerProcess::GetArgV
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 23 11:05:46 PST 2021
Author: Vitaly Buka
Date: 2021-12-23T11:05:37-08:00
New Revision: 9fe0d67c9a72488a8d51bdbff52916a91bc06914
URL: https://github.com/llvm/llvm-project/commit/9fe0d67c9a72488a8d51bdbff52916a91bc06914
DIFF: https://github.com/llvm/llvm-project/commit/9fe0d67c9a72488a8d51bdbff52916a91bc06914.diff
LOG: [sanitizer] Check kArgVMax in SymbolizerProcess::GetArgV
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp
index 79687ca5f72de..e9829326bcd6f 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp
@@ -281,6 +281,7 @@ class LLVMSymbolizerProcess final : public SymbolizerProcess {
argv[i++] = inline_flag;
argv[i++] = kSymbolizerArch;
argv[i++] = nullptr;
+ CHECK_LE(i, kArgVMax);
}
};
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
index a916a03234fe9..ac811c8a9136d 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
@@ -91,6 +91,7 @@ class AtosSymbolizerProcess final : public SymbolizerProcess {
argv[i++] = "-d";
}
argv[i++] = nullptr;
+ CHECK_LE(i, kArgVMax);
}
char pid_str_[16];
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp
index 888ee7fe89bc9..8167db42a7abc 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp
@@ -218,6 +218,7 @@ class Addr2LineProcess final : public SymbolizerProcess {
argv[i++] = "-Cfe";
argv[i++] = module_name_;
argv[i++] = nullptr;
+ CHECK_LE(i, kArgVMax);
}
bool ReachedEndOfOutput(const char *buffer, uptr length) const override;
More information about the llvm-commits
mailing list