提交 41efd948 编写于 作者: X xiacong

bugfix: 1、change seccomp hook install order to enable seccomp in updater mode

2、增加空指针校验
Signed-off-by: Nxiacong <xiacong4@huawei.com>
Change-Id: I6680f4b198b9be420af804314ee2a239f506c4ad
Signed-off-by: Nxiacong <xiacong4@huawei.com>

Change-Id: I324ee31c372c3b2174bf86bb6698d7835e74dc97
Signed-off-by: Nxiacong <xiacong4@huawei.com>
上级 923f8528
...@@ -121,7 +121,7 @@ static bool GetFilterFileByName(const char *filterName, char *filterLibRealPath, ...@@ -121,7 +121,7 @@ static bool GetFilterFileByName(const char *filterName, char *filterLibRealPath,
} }
// allow only one path to a seccomp shared library to avoid shared library replaced // allow only one path to a seccomp shared library to avoid shared library replaced
if (seccompPathNum == 1) { if (seccompPathNum == 1 && files && files->paths[0]) {
if (memcpy_s(filterLibRealPath, pathSize, files->paths[0], strlen(files->paths[0]) + 1) == EOK) { if (memcpy_s(filterLibRealPath, pathSize, files->paths[0], strlen(files->paths[0]) + 1) == EOK) {
flag = true; flag = true;
} }
......
...@@ -53,5 +53,5 @@ static int SeccompHook(const HOOK_INFO *info, void *cookie) ...@@ -53,5 +53,5 @@ static int SeccompHook(const HOOK_INFO *info, void *cookie)
MODULE_CONSTRUCTOR(void) MODULE_CONSTRUCTOR(void)
{ {
InitAddPostPersistParamLoadHook(0, SeccompHook); InitAddPostCfgLoadHook(0, SeccompHook);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册