MDEV-38010: Master/Relay Log Info files ignore trailing garbage in numeric lines#4752
Open
ayush-jha123 wants to merge 1 commit intoMariaDB:mainfrom
Open
MDEV-38010: Master/Relay Log Info files ignore trailing garbage in numeric lines#4752ayush-jha123 wants to merge 1 commit intoMariaDB:mainfrom
ayush-jha123 wants to merge 1 commit intoMariaDB:mainfrom
Conversation
…meric lines This patch fixes an issue where Int_IO_CACHE::from_chars stops parsing at the first invalid character but fails to consume the remainder of the line. This caused trailing garbage on a numeric field (like Master_Port) to be interpreted as the value for the subsequent field. The fix adds a loop to consume the buffer up to the newline character or EOF if my_strtoll10 returns early.
ParadoxV5
requested changes
Mar 7, 2026
Contributor
There was a problem hiding this comment.
By stopping early, #4430 has already fixed this bug (or rather, what MDEV-38010 actually described) on the main branch as part of MDEV-37530.
Please retarget to 10.11, and add a test (refer to the bug report’s examples) while you’re there.
(I dearly hope this is not an AI being confident at an nonexistent bug.)
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 https://jira.mariadb.org/browse/MDEV-38010
Description:
This patch fixes an issue where
Int_IO_CACHE::from_charsstops parsing at the first invalid character but fails to consume the remainder of the line.Previously, this caused trailing garbage on a numeric field (e.g.,
Master_Port) to be interpreted as the value for the subsequent field, leading to corrupted configurations. The fix adds a loop to consume the buffer up to the newline character or EOF ifmy_strtoll10returns early, safely discarding the trailing text.