diff --git a/fs/vfs/epoll/fs_epoll.c b/fs/vfs/epoll/fs_epoll.c index 1eeec53ac837433225542247699ab627e8a1861b..8591d61287823ef6995685e725914ff21aa17d46 100755 --- a/fs/vfs/epoll/fs_epoll.c +++ b/fs/vfs/epoll/fs_epoll.c @@ -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; } diff --git a/syscall/fs_syscall.c b/syscall/fs_syscall.c index 99cd5213b7cf0d9837595eaee4c8ff323d2a50d5..40d4c0c23ee2c0a332c0ce5ae4eb70fdf43f0a91 100755 --- a/syscall/fs_syscall.c +++ b/syscall/fs_syscall.c @@ -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));