Skip to content

Conversation

@Mukikaizoku
Copy link
Collaborator

Discovered that when removing submessages such that the parent remains large post removal (>=256 bytes), that the 2nd byte of the length ushort in the parent message header is truncated to 0.

This leads to consumers of the message to read a corrupted length, which in turn breaks deserialization in unpredictable ways.

This PR adds two unit tests, which, from the standpoint of before the fix, act as a positive control for the small message case and another that demonstrates the discovered bug.

The PR also fixes the bug, by adjusting the assignment of the aforementioned 2nd byte of the length ushort.

Copy link
Collaborator

@blurdot blurdot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, lgtm!

@Mukikaizoku Mukikaizoku merged commit c6a228c into main Nov 4, 2025
5 checks passed
@Mukikaizoku Mukikaizoku deleted the mik/fix-largemsg-adjustlen branch November 4, 2025 17:11
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.

3 participants