| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
remove eventhandler in common_event_service Signed-off-by: cheerful_ricky <yuegang7@huawei.com> | 5 个月前 | |
fix(ces): canonicalize file path before opening ifstream in GetJsonFromFile Use realpath() to canonicalize the path parameter in InnerCommonEventManager::GetJsonFromFile. After canonicalization, add IsValidConfigPath whitelist check to ensure the canonical path is under a controlled directory (/system/etc/, /vendor/etc/, /chipset/etc/), preventing arbitrary file reads. Then open the file with std::ifstream using the canonical path. This follows the realpath+whitelist pattern used in hiviewdfx IsValidPath (faultlog_util.cpp). Add unit tests for GetJsonFromFile covering all branches: - nullptr path, non-existent path (realpath fail) - path outside whitelist (IsValidConfigPath fail) - directory in whitelist (ifstream fail) - invalid/scalar/null/empty/array JSON content (parse fail) - valid JSON object (success) Closes #1238 Co-Authored-By: Agent Signed-off-by: CheerfulRicky <yuegang7@h-partners.com> Change-Id: I2a2d3aa22794c96fe5e048c5915ec09dbfe1f7c8 | 3 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 5 个月前 | ||
| 3 天前 |