添加restrictValue范围判断

Signed-off-by: ganchuantao <ganchuantao1@huawei.com>
This commit is contained in:
ganchuantao 2024-11-15 10:12:44 +00:00 committed by Gitee
parent 023dc9ec26
commit 2ba848cfcc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -120,6 +120,11 @@ std::string FtraceFsOps::GetKernelSymbols() const
CHECK_TRUE(restrictValue.size() > 0, "", "read kptr_restrict failed!");
bool valueChanged = false;
if (restrictValue.find("0") == string::npos && restrictValue.find("1") == string::npos
&& restrictValue.find("2") == string::npos) {
PROFILER_LOG_ERROR(LOG_CORE, "not value string");
return ""
}
if (std::stoi(restrictValue) == 0) {
SetKptrRestrict("1");
valueChanged = true;