Skip to content

rsyslog: fix octet-counted framing on oversize messages#193

Merged
jclarysse merged 1 commit into
masterfrom
dogukancagatay/fix-octet-counted-overflow-edge-case
May 11, 2026
Merged

rsyslog: fix octet-counted framing on oversize messages#193
jclarysse merged 1 commit into
masterfrom
dogukancagatay/fix-octet-counted-overflow-edge-case

Conversation

@dogukancagatay
Copy link
Copy Markdown
Contributor

When octet_counted_framing is enabled and the encoded message
exceeds max_message_size, the previous code advertised the full
body length in the frame prefix but only sent a truncated body
(plus a stray newline). RFC 6587 octet-counted receivers then
consumed bytes from the following frame to make up the count,
desyncing the entire connection.

Truncate the body before computing the prefix length, drop the
non-transparent newline in octet-counted mode, and document that
max_message_size bounds the body bytes in both modes.

When `octet_counted_framing` is enabled and the encoded message
exceeds `max_message_size`, the previous code advertised the full
body length in the frame prefix but only sent a truncated body
(plus a stray newline). RFC 6587 octet-counted receivers then
consumed bytes from the following frame to make up the count,
desyncing the entire connection.

Truncate the body before computing the prefix length, drop the
non-transparent newline in octet-counted mode, and document that
`max_message_size` bounds the body bytes in both modes.
@dogukancagatay dogukancagatay marked this pull request as ready for review May 6, 2026 13:48
@dogukancagatay dogukancagatay requested a review from jclarysse May 6, 2026 13:48
Copy link
Copy Markdown
Contributor

@jclarysse jclarysse left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jclarysse jclarysse merged commit fa2c111 into master May 11, 2026
6 checks passed
@jclarysse jclarysse deleted the dogukancagatay/fix-octet-counted-overflow-edge-case branch May 11, 2026 08:22
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