Skip to content

Commit

Permalink
Coverity polish: 1605316 Overflowed constant
Browse files Browse the repository at this point in the history
Add assertion that we only process wait events which we have counted, anything
else is a bug.
  • Loading branch information
nigoroll committed Sep 12, 2024
1 parent 8c72c41 commit 33d8a53
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/varnishd/waiter/cache_waiter_epoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ vwe_thread(void *priv)
}
CHECK_OBJ_NOTNULL(wp, WAITED_MAGIC);
AZ(epoll_ctl(vwe->epfd, EPOLL_CTL_DEL, wp->fd, NULL));
AN(vwe->nwaited);
vwe->nwaited--;
AN(Wait_HeapDelete(w, wp));
Lck_Unlock(&vwe->mtx);
Expand Down Expand Up @@ -138,6 +139,7 @@ vwe_thread(void *priv)
continue;
}
AZ(epoll_ctl(vwe->epfd, EPOLL_CTL_DEL, wp->fd, NULL));
AN(vwe->nwaited);
vwe->nwaited--;
if (ep->events & EPOLLIN) {
if (ep->events & EPOLLRDHUP &&
Expand Down

0 comments on commit 33d8a53

Please sign in to comment.