未验证 提交 2f3e2c36 编写于 作者: O openharmony_ci 提交者: Gitee

!6896 【OpenHarmony 3.2.9.1】【安全子系统】Huks用例问题修改

Merge pull request !6896 from qiaozzzh/1212_1
......@@ -104,6 +104,9 @@ static uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, ui
}
char filePath[PATH_MAX + 1] = {0};
if (memcpy_s(filePath, sizeof(filePath) - 1, fileName, strlen(fileName)) != EOK) {
return HKS_ERROR_BAD_STATE;
}
if (strstr(filePath, "../") != NULL) {
HKS_TEST_LOG_E("invalid filePath, path %s", filePath);
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册