diff --git a/services/src/appspawn_process.c b/services/src/appspawn_process.c index 0a6edad85293b87d150f67d3fbe38c2b964d642f..e9ca1038d1fe312da79ed6907f121dad8359ceb9 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;