Repository navigation
fix(parser): reject day overflow before calendar conversion - #129
Merged
Merged
Conversation
stacknil
force-pushed
the
reliability/syslog-day-boundaries
branch
from
October 15, 2026 14:06
e04cd5f to
92ad73d
Compare
stacknil
marked this pull request as ready for review
October 18, 2026 14:44
Signed-off-by: stacknil <219124580+stacknil@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.
Summary
Reject day integers outside
1..31before constructingstd::chrono::day, then retain the existing month/leap-year validation. Add a normal CTest regression, a focused optional fuzz target with three synthetic seeds, and the parser contract/evidence reports.Why
At baseline
e2937e8, the existing seven CTest entries passed, butMar 257 ...was accepted after integer narrowing produced an apparently valid date. The new regression fails immediately against that original library. Sanitizers alone do not detect this semantic contract violation.Behavior change
Out-of-domain day integers now produce the existing
unknown_timestamp/invalid calendar datewarning and do not contribute parsed events. Integer overflow and malformed tokens retaininvalid day token. Valid dates, diagnostics, stream accounting, and recovery are covered by 2,927 deterministic cases and one three-line recovery stream. The month-length oracle is independent of the adversarial calendar conversion.Validation
Independent local validation completed on this exact diff:
257.fuzz_timestamp_day -runs=10000 -seed=20261015 -max_len=4096 -timeout=2 -print_final_stats=1completed with no crash or oracle failure.See
FUZZING-OR-BOUNDARY-TEST-REPORT.mdfor complete build/run commands. The fuzz oracle sharesfrom_charswith production: its independent property is checking the numeric domain before narrowing, rather than independent lexical validation. Finite clean sanitizer/fuzz runs do not establish exhaustive memory safety. Local execution used Linux/libstdc++; Windows/MSVC is left to remote CI.Compatibility
The five-line production guard preserves valid-input parsing, detector behavior, report schema, and existing golden fixtures. Consumers relying on invalid-day acceptance will observe fewer parsed events and an existing timestamp warning. The main remaining limitation is platform/coverage breadth, not a new parser grammar or dependency.
Rollback: revert this commit; no migration is required, and the invalid-day acceptance would return.
This PR starts as draft because its test corpus and evidence package span 11 files. Remote CI on
92ad73dpassed all 11 visible checks across push and PR runs: Linux/Windows CTest, parser fuzz smoke, Repo Sentinel, and CodeQL. Final remote diff review matched the independently reviewed content.GitHub now verifies this signed commit (
verified: true,reason: valid) using the account's public noreply identity and the original GPG key. The identity metadata correction preserves the reviewed source tree, parent, and commit message.