From 879803c90f8ab13bdb7436dfd966088e9b4d9d53 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Tue, 25 Sep 2018 09:07:49 +0200 Subject: [PATCH] gnu.cfg: Fixed FP (nullpointer) when third parameter of epoll_ctl is set to NULL. --- cfg/gnu.cfg | 1 - test/cfg/gnu.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cfg/gnu.cfg b/cfg/gnu.cfg index 223caef2f..f79789217 100644 --- a/cfg/gnu.cfg +++ b/cfg/gnu.cfg @@ -653,7 +653,6 @@ - diff --git a/test/cfg/gnu.c b/test/cfg/gnu.c index 8b1127762..b97f181dd 100644 --- a/test/cfg/gnu.c +++ b/test/cfg/gnu.c @@ -8,6 +8,7 @@ // #include +#include void bufferAccessOutOfBounds() { @@ -37,3 +38,16 @@ void leakReturnValNotUsed() if (42 == __builtin_expect(42, 0)) 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); +}