提交 2f1ed39b 编写于 作者: W wangchen

fix: 内源代码检视问题

【背景】内源代码检视问题

【修改方案】
1,按检视意见,进行资源泄露等问题的修改

【影响】
对现有的产品编译不会有影响。

re #I4WV56
Signed-off-by: Nwangchen <wangchen64@huawei.com>
上级 0fb16312
......@@ -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.
先完成此消息的编辑!
想要评论请 注册