net: bound WSAConnectByList's title-supplied count #469
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/469"
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?
Imported from fxceless/victory-fork. Originally posted by davutsimsekk on 2026-11-25T01:19:42Z.
WSAConnectByListread 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: cleanImported from fxceless/victory-fork. Originally posted by kaayzouee on 2026-11-25T01:41:17Z.
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.
Imported from fxceless/victory-fork. Originally posted by davutsimsekk on 2026-11-25T03:36:18Z.
Duplicate of #466, which implements the same 64-entry bound and an older branch. Closing this one in favor of it.
Pull request closed