align overlapped to CPython 3.14.2#7005
Conversation
📝 WalkthroughWalkthroughThis change refactors the Windows overlapped I/O module by introducing module initialization with Winsock setup, adding garbage collection traversal support through Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
79991e7 to
b18bdbc
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
crates/stdlib/src/overlapped.rs (2)
1826-1862:⚠️ Potential issue | 🟡 MinorFix incorrect error message for unsupported address family.
BindLocaltakes an address family, not a tuple length.Proposed fix
- return Err(vm.new_value_error("expected tuple of length 2 or 4".to_owned())); + return Err(vm.new_value_error("unsupported address family".to_owned()));
1395-1482:⚠️ Potential issue | 🔴 CriticalValidate
sizeagainst buffer length to prevent out-of-bounds writes.
WSARecvFromwritesWSABUF.lenbytes into the buffer. Ifsizeexceedsbuf.desc.len, Windows writes past the buffer boundary. Compare this withWSARecvInto, which correctly uses the buffer length directly.Proposed fix
let buf_len = buf.desc.len; if buf_len > u32::MAX as usize { return Err(vm.new_value_error("buffer too large".to_owned())); } + if size as usize > buf_len { + return Err(vm.new_value_error("size exceeds buffer length".to_owned())); + }
Summary by CodeRabbit
Bug Fixes
Improvements