net: bound WSAConnectByList's title-supplied count #469
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!469
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/469/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@davutsimsekk on GitHub · 2026-11-25 01:19 UTC · original
davutsimsekk:fix/wsa-connect-list-count→main· +30 −4 · 1 files · 1 commits · closed without mergingWSAConnectByListread the title-suppliedSOCKET_ADDRESS_LISTcount as ani32and passed it straight tostd::slice::from_raw_parts. A negative or huge count (for examplei32::MAX) built an unbounded slice beforereachable()ran, so the shim hit undefined behaviour instead of refusing the call.This bounds the count to 64 entries and returns
WSAEINVALfor negative or oversized values. The count is read unaligned; lists within the bound are unchanged.Fixes #428.
Test
a_socket_address_list_count_is_boundedchecks 2 and 0 are accepted, while -1 andi32::MAXare refused.cargo test -p victory-hle --lib: 97 passed, 0 failedcargo clippy -p victory-hle --all-targets --locked -- -D warnings: cleanrustfmt --edition 2024 --check crates/victory-hle/src/modules/net.rs: clean@kaayzouee on GitHub · 2026-11-25 01:41 UTC · original
Is this a duplicate of #466?
Both bound the title-supplied WSAConnectByList count to 64 and reject invalid counts.
This is an automated message. If you believe it is incorrect, please reply with the relevant technical differences.
@davutsimsekk on GitHub · 2026-11-25 03:36 UTC · original
Duplicate of #466, which implements the same 64-entry bound and an older branch. Closing this one in favor of it.
Pull request closed