Skip to content

Fix[PushMessageImpl]: validate PUSH message sizes - #188

Merged
678098 merged 1 commit into
bloomberg:mainfrom
678098:261116_push_validation
Nov 17, 2026
Merged

678098 merged 1 commit into
bloomberg:mainfrom
678098:261116_push_validation

Conversation

@678098

@678098 678098 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Reject PUSH messages where the header is bigger than the message, or the options leave no room for data.

@678098
678098 requested a review from a team as a code owner November 16, 2026 16:50
int optionSize = header.optionsWords() * Protocol.WORD_SIZE;
if (appDataSize <= optionSize) {
throw new IOException("Invalid options size: " + optionSize);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If the appDataSize <= optionSize condition is false
=> optionSize < appDataSize
=> 0 < appDataSize - optionSize
=> 0 < dataSize (line 132)

Reject PUSH messages where the header is bigger than the message,
or the options leave no room for data.

Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
@678098
678098 force-pushed the 261116_push_validation branch from ab15fc9 to 7b72671 Compare November 17, 2026 15:26
@678098
678098 merged commit fd0a618 into bloomberg:main Nov 17, 2026
17 checks passed
@678098
678098 deleted the 261116_push_validation branch November 17, 2026 15:55
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