指针使用前判空

Signed-off-by: ohxianzhi <duxianzhi@huawei.com>
This commit is contained in:
ohxianzhi 2024-10-10 21:03:04 +08:00
parent 7142749cc1
commit 35ea789704
2 changed files with 2 additions and 1 deletions

View File

@ -151,6 +151,7 @@ int SetUidGidFilter(const AppSpawnMgr *content)
int SetSeccompFilter(const AppSpawnMgr *content, const AppSpawningCtx *property)
{
#ifdef WITH_SECCOMP
APPSPAWN_CHECK(property != nullptr, return 0, "property is NULL");
const char *appName = APP_NAME;
SeccompFilterType type = APP;

View File

@ -208,7 +208,7 @@ APPSPAWN_STATIC void ProcessSignal(const struct signalfd_siginfo *siginfo)
static void AppSpawningCtxOnClose(const AppSpawnMgr *mgr, AppSpawningCtx *ctx, void *data)
{
if (ctx->message == NULL || ctx->message->connection != data) {
if (ctx == NULL || ctx->message == NULL || ctx->message->connection != data) {
return;
}
APPSPAWN_LOGI("Kill process, pid: %{public}d app: %{public}s", ctx->pid, GetProcessName(ctx));