!183 fix: dereference NULL point bug fix

Merge pull request !183 from MGY917/signal_bug_fix
This commit is contained in:
openharmony_ci 2021-04-25 14:20:21 +08:00 committed by Gitee
commit 806ce4eb26
1 changed files with 5 additions and 1 deletions

View File

@ -270,8 +270,12 @@ int OsSigProcessSend(LosProcessCB *spcb, siginfo_t *sigInfo)
.receivedTcb = NULL .receivedTcb = NULL
}; };
if (info.sigInfo == NULL){
return -EFAULT;
}
/* visit all taskcb and dispatch signal */ /* visit all taskcb and dispatch signal */
if ((info.sigInfo != NULL) && (info.sigInfo->si_signo == SIGKILL)) { if (info.sigInfo->si_signo == SIGKILL) {
(void)OsSigProcessForeachChild(spcb, SigProcessKillSigHandler, &info); (void)OsSigProcessForeachChild(spcb, SigProcessKillSigHandler, &info);
OsSigAddSet(&spcb->sigShare, info.sigInfo->si_signo); OsSigAddSet(&spcb->sigShare, info.sigInfo->si_signo);
OsWaitSignalToWakeProcess(spcb); OsWaitSignalToWakeProcess(spcb);