Bugfix: protocol: Enforce username length limit seeking into message#181
Bugfix: protocol: Enforce username length limit seeking into message#181luke-jr wants to merge 4 commits intoOCEAN-xyz:masterfrom
Conversation
Without this, only 384 bytes get written for the username, but extra space is included in the message before the rest of the data
There was a problem hiding this comment.
Pull request overview
Fixes a protocol message framing issue in datum_protocol_pow() by ensuring the username field advances the message cursor by the actual written byte count (bounded to the buffer limit), preventing unintended gaps in the serialized message.
Changes:
- Switch from
i += snprintf(...)to capturing thesnprintfresult injfor the username field. - Clamp the username byte-count used to advance
ito the protocol/buffer maximum. - Advance
ibyj + 1to account for the terminating null byte.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…otocol_submit_username
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Without this, only 384 bytes get written for the username, but extra space is included in the message before the rest of the data