Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RNET-1175 Fix potential outgoing message corruption in managed websockets #3670

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

fealebenpae
Copy link
Member

@fealebenpae fealebenpae commented Sep 16, 2024

Description

When managed websockets are enabled we use array pooling to cut down on constant managed heap allocations for the byte arrays that store the sync messages Core wants us to send. However there is a chance that if a rented array is bigger than the buffer we need to store we will attempt to send the entire array, including stale data it contained previously. This is avoided by using the ArraySegment<T> constructor that accepts the explicit offset and length parameters.

Fixes #3671

TODO

  • Changelog entry
  • Tests

@fealebenpae fealebenpae self-assigned this Sep 16, 2024
@cla-bot cla-bot bot added the cla: yes label Sep 16, 2024
@fealebenpae fealebenpae changed the title Fix potential outgoing message corruption in managed websockets RNET-1175 Fix potential outgoing message corruption in managed websockets Sep 16, 2024
@fealebenpae fealebenpae merged commit a1ae02c into main Sep 16, 2024
56 of 61 checks passed
@fealebenpae fealebenpae deleted the yg/managed-websocket-send branch September 16, 2024 16:01
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential outgoing message corruption in managed websockets
2 participants