WSAConnectByList reads at most 64 candidates and refuses a negative c… #521

Open
pug205gti6 wants to merge 1 commit from upstream-pr/521 into main
pug205gti6 commented 2026-11-25 01:58:25 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by pug205gti6 on 2026-11-25T01:58:25Z.


…ount

The count of a SOCKET_ADDRESS_LIST came from the title and became the length of a slice with no upper bound, so a count past the entries present read memory after the list as addresses (#428). A count below zero or above 64 now fails with WSAEINVAL before anything after the count is read and without the host seeing the list; the entries are read one by one with read_unaligned instead of through a slice.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6595385051 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/521). Originally posted by [pug205gti6](https://github.com/pug205gti6) on 2026-11-25T01:58:25Z. --- …ount The count of a SOCKET_ADDRESS_LIST came from the title and became the length of a slice with no upper bound, so a count past the entries present read memory after the list as addresses (#428). A count below zero or above 64 now fails with WSAEINVAL before anything after the count is read and without the host seeing the list; the entries are read one by one with read_unaligned instead of through a slice.
Revens2 commented 2026-11-25 08:09:01 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Revens2 on 2026-11-25T07:36:33Z.


Duplicate of #466: @Frtuchinno opened this patch 41 minutes earlier, and gh pr diff returns the same bytes for both (+95/-9 on 1 file(s), same title).

Please continue in #466 so the review history and any test data stay in one place.
Thanks.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7156052494 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/521#issuecomment-7156052494). Originally posted by [Revens2](https://github.com/Revens2) on 2026-11-25T07:36:33Z. --- Duplicate of #466: @Frtuchinno opened this patch 41 minutes earlier, and `gh pr diff` returns the same bytes for both (+95/-9 on 1 file(s), same title). Please continue in #466 so the review history and any test data stay in one place. Thanks.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/521:upstream-pr/521'
git switch 'upstream-pr/521'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/521'
git switch 'upstream-pr/521'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/521'
git switch 'upstream-pr/521'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/521'
git switch 'main'
git merge --squash 'upstream-pr/521'
git switch 'main'
git merge --ff-only 'upstream-pr/521'
git switch 'main'
git merge 'upstream-pr/521'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!521
No description provided.