From a91b98ecf64227f0b7a25a94b6ecf4a456ec4b8f Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Thu, 18 Sep 2025 11:05:51 -0700 Subject: [PATCH 1/2] Check for invalid filter index in windows_kevent_copyout --- src/windows/platform.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/windows/platform.c b/src/windows/platform.c index 52afa11d..f0c1bf01 100644 --- a/src/windows/platform.c +++ b/src/windows/platform.c @@ -134,11 +134,17 @@ windows_kevent_copyout(struct kqueue *kq, int nready, { struct filter *filt; struct knote* kn; - int rv, nret; + int rv, nret, filt_index; //FIXME: not true for EVFILT_IOCP kn = (struct knote *) iocp_buf.overlap; - filt = &kq->kq_filt[~(kn->kev.filter)]; + filt_index = ~(kn->kev.filter); + if (filt_index < 0 || filt_index >= EVFILT_SYSCOUNT) { + dbg_puts("bad filter index in windows_kevent_copyout"); + return 0; + } + filt = &kq->kq_filt[filt_index]; + rv = filt->kf_copyout(eventlist, nevents, filt, kn, &iocp_buf); if (unlikely(rv < 0)) { dbg_puts("knote_copyout failed"); From 1a9e49f431deedd6e4b92b2d7a5916f5de0d937f Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Thu, 18 Sep 2025 11:16:48 -0700 Subject: [PATCH 2/2] Bump Windows CMake generator to Visual Studio 2022 --- .github/workflows/ci-windows.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index d5853650..3e00693a 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -36,9 +36,8 @@ jobs: - name: Configure build system run: | cmake --version - cmake -S . -B build_x64 -A x64 -G "Visual Studio 16 2019" -DSTATICLIB=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON + cmake -S . -B build_x64 -A x64 -G "Visual Studio 17 2022" -DSTATICLIB=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON - name: Build libkqueue run: | cmake --build build_x64 --target install --config Release --parallel 1 -