Skip to content

Require exact buffer size for dequeue(Args...) - #11

Merged
sbooth merged 1 commit into
mainfrom
dequeue-size
Jul 10, 2026
Merged

Require exact buffer size for dequeue(Args...)#11
sbooth merged 1 commit into
mainfrom
dequeue-size

Conversation

@sbooth

@sbooth sbooth commented Jul 10, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 10, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR makes MessageQueue::dequeue(Args&...) require an exact byte-size match between the stored message and the requested argument pack, preventing typed dequeues from silently accepting messages with trailing bytes.

Changes:

  • Update dequeue(Args&...) to fail unless data.size() == sum(sizeof(Args)...).
  • Adjust API documentation to note that typed dequeue fails on “insufficient or excess data”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 147 to +148
/// @return true if the message values were successfully copied, false if the queue is empty or the slot contains
/// insufficient data.
/// insufficient or excess data.
@sbooth
sbooth merged commit 801742a into main Jul 10, 2026
8 checks passed
@sbooth
sbooth deleted the dequeue-size branch July 10, 2026 14:14
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