提交 5efc3b51 编写于 作者: Q qiaozzzh

huks用例问题修改

Signed-off-by: Nqiaozzzh <qiaozhang@huawei.com>
Change-Id: I8c8c7b5f4f1c640389ad9a73ea403f5281217490
上级 50ebdb52
......@@ -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.
先完成此消息的编辑!
想要评论请 注册