未验证 提交 2df39a7e 编写于 作者: O openharmony_ci 提交者: Gitee

!825 A核内源代码检视问题修改2

Merge pull request !825 from wangchen/0310_a
......@@ -242,6 +242,11 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
return ret;
}
if (ev == NULL) {
set_errno(EINVAL);
return -1;
}
switch (op) {
case EPOLL_CTL_ADD:
ret = CheckFdExist(epHead, fd);
......@@ -304,7 +309,7 @@ int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents, int timeout
return -1;
}
if (maxevents <= 0) {
if ((maxevents <= 0) || (evs == NULL)) {
set_errno(EINVAL);
return -1;
}
......
......@@ -2570,7 +2570,9 @@ int SysPselect6(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
CPY_FROM_USER(exceptfds);
DUP_FROM_USER(timeout, sizeof(struct timeval));
((struct timeval *)timeout)->tv_usec = timeout->tv_nsec / 1000; /* 1000, convert ns to us */
if (timeout != NULL) {
((struct timeval *)timeout)->tv_usec = timeout->tv_nsec / 1000; /* 1000, convert ns to us */
}
if (data != NULL) {
retVal = LOS_ArchCopyFromUser(&(setl.sig[0]), (int *)((UINTPTR)data[0]), sizeof(sigset_t));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册