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

fix: prevent data corruption in multiPacketListener by avoiding buffer resizing #213

Merged
merged 3 commits into from
Sep 20, 2024

Conversation

sbruens
Copy link

@sbruens sbruens commented Sep 20, 2024

The multiPacketListener suffered from data corruption due to improper handling of the shared read buffer, resizing the shared read buffer after each read. This resizing could lead to data corruption when subsequent reads involved larger packets.

This commit resolves the issue by avoiding resizing of the original buffer. Instead, a new slice is created to represent the received data, ensuring that the buffer remains at its original size.

@sbruens sbruens marked this pull request as ready for review September 20, 2024 14:06
@sbruens sbruens requested a review from a team as a code owner September 20, 2024 14:06
@sbruens sbruens merged commit e8ec4d0 into master Sep 20, 2024
5 checks passed
@sbruens sbruens deleted the sbruens/udp-buffer branch September 20, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants