From b0a44ae9cef563b2b2e7a1981e1aff6d1ce24285 Mon Sep 17 00:00:00 2001 From: jmp0 <302864369@qq.com> Date: Sun, 6 Jun 2021 10:53:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DmsgSt=E6=8C=87=E9=92=88?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jmp0 <302864369@qq.com> --- services/src/appspawn_process.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/src/appspawn_process.c b/services/src/appspawn_process.c index 0a6edad..e9ca103 100755 --- a/services/src/appspawn_process.c +++ b/services/src/appspawn_process.c @@ -133,7 +133,12 @@ static int SetPerms(uid_t uID, gid_t gID, unsigned int capsCnt, const unsigned i pid_t CreateProcess(const MessageSt* msgSt) { - pid_t newPID = fork(); + pid_t newPID; + if (msgSt == NULL){ + HILOG_ERROR(HILOG_MODULE_HIVIEW, "[appspawn] create process, msgSt is NULL", errno); + return -1; + } + newPID = fork(); if (newPID < 0) { HILOG_ERROR(HILOG_MODULE_HIVIEW, "[appspawn] create process, fork failed! err %{public}d.", errno); return -1; -- Gitee