app/vlinsert/syslog: fix embedded newline in TCP syslog corrupting the next message#1564
Open
func25 wants to merge 4 commits into
Open
app/vlinsert/syslog: fix embedded newline in TCP syslog corrupting the next message#1564func25 wants to merge 4 commits into
func25 wants to merge 4 commits into
Conversation
func25
marked this pull request as ready for review
July 2, 2026 12:52
Contributor
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Signed-off-by: Phuong Le <39565248+func25@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1365
A syslog message sent over TCP with an embedded newline could corrupt the next message. This is a known limitation of octet stuffing (see RFC 6587 §3.4.2). VictoriaLogs cannot avoid splitting such a message, but it should not let the leftover corrupt the next message and should handle it gracefully, as it already does for other malformed input.
Fixed by peeking the first byte to detect the framing method and reading each octet-stuffing frame up to its LF, so a frame can no longer leak into the next one. Also replaces the
gotowith a plain loop and drops the redundant prefix scan/copy, so the path does fewer reads per message.+, syslog ingestion is best-effort to cover many weird cases of old syslog, so I don't think warning logs are needed here.
In the reported case, before
after