gnu.cfg: Fixed FP (nullpointer) when third parameter of epoll_ctl is set to NULL.

This commit is contained in:
orbitcowboy 2018-09-25 09:07:49 +02:00
parent 5e120b567c
commit 879803c90f
2 changed files with 14 additions and 1 deletions

View File

@ -653,7 +653,6 @@
</arg> </arg>
<arg nr="4"> <arg nr="4">
<not-bool/> <not-bool/>
<not-null/>
</arg> </arg>
</function> </function>
<!-- int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout); --> <!-- int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout); -->

View File

@ -8,6 +8,7 @@
// //
#include <string.h> #include <string.h>
#include <sys/epoll.h>
void bufferAccessOutOfBounds() void bufferAccessOutOfBounds()
{ {
@ -37,3 +38,16 @@ void leakReturnValNotUsed()
if (42 == __builtin_expect(42, 0)) if (42 == __builtin_expect(42, 0))
return; return;
} }
int nullPointer_epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
{
// no warning is expected
(void)epoll_ctl(epfd, op, fd, event);
// No nullpointer warning is expected in case op is set to EPOLL_CTL_DEL
// EPOLL_CTL_DEL
// Remove (deregister) the target file descriptor fd from the
// epoll instance referred to by epfd. The event is ignored and
// can be NULL.
return epoll_ctl(epfd, EPOLL_CTL_DEL, fd, NULL);
}