diff --git a/services/modules/seccomp/seccomp_policy.c b/services/modules/seccomp/seccomp_policy.c index b80c646b6644eac140eb9ce3acaa920d223f0e77..78509ae5480d55d584ccf60dc11519663a91a2d7 100644 --- a/services/modules/seccomp/seccomp_policy.c +++ b/services/modules/seccomp/seccomp_policy.c @@ -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 - if (seccompPathNum == 1) { + if (seccompPathNum == 1 && files && files->paths[0]) { if (memcpy_s(filterLibRealPath, pathSize, files->paths[0], strlen(files->paths[0]) + 1) == EOK) { flag = true; } diff --git a/services/modules/seccomp/seccomp_policy_static.c b/services/modules/seccomp/seccomp_policy_static.c index 8ced87af4f65de68d3b97489fef9a765530f9cd1..98f82cc4702d39ea23e8d66d11f7843fe745eb87 100644 --- a/services/modules/seccomp/seccomp_policy_static.c +++ b/services/modules/seccomp/seccomp_policy_static.c @@ -53,5 +53,5 @@ static int SeccompHook(const HOOK_INFO *info, void *cookie) MODULE_CONSTRUCTOR(void) { - InitAddPostPersistParamLoadHook(0, SeccompHook); + InitAddPostCfgLoadHook(0, SeccompHook); }