Preserve empty Access values and harden timestamp parsing#9
Merged
Conversation
added 2 commits
June 6, 2026 13:49
Truncated or inconsistent Jet4 variable-column offset tables can ask the reader to step backwards past the start of the row. Using wrapping subtraction turns that into a huge index, so stop scanning when the next offset entry would underflow. Tested: cargo test -p jetdb
Access rows can distinguish a non-null empty Text/Binary value from NULL via the null mask. The parser also accepted malformed DateTimeExtended payloads by parsing failures as zero, and rounded ordinary timestamps could produce 24:00:00 instead of carrying into the next day. Constraint: Keep the public Value API unchanged for an upstream-friendly focused fix Rejected: Add a new invalid/raw cell variant in this patch | broader public API change best handled as a separate diagnostics design Confidence: high Scope-risk: narrow Tested: cargo test -p jetdb Tested: scripts/quality-check.sh
Author
|
@dominion525 ping |
Owner
|
Hi @Else00 — sorry for the long delay, and for not responding to the ping sooner. Reviewed everything and all four fixes are genuine correctness improvements:
Merging this now. After it lands I'll cherry-pick the regression test from #8 on top of main (Bradyok's Re: your note in the PR description — really glad to hear someone is actually using jetdb in a real application. Thank you for the patch and for the patience. |
dominion525
pushed a commit
that referenced
this pull request
Jun 20, 2026
Cherry-picked the regression test from #8. The underlying overflow itself was addressed in #9 via a different approach (checked_sub), but this var_col_count=100 / 7-byte reproducer is independently useful for guarding against future regressions. (cherry picked from commit 2d924b5) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Jun 20, 2026
Merged
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
This fixes a few correctness edge cases in Jet/ACE row decoding:
Value::NullDateTimeExtendedpayloads instead of parsing them as zero/epoch-like dates23:59:59to the next day at00:00:00Details
For variable-length values,
start == endis a valid non-null empty value. The decoder now treats onlystart > endor out-of-bounds offsets as invalid.For
DateTimeExtended, the parser now validates the expected 42-byte layout, separators, marker bytes, ASCII digits, and ranges before returning a parsed value. Malformed payloads are preserved as raw binary by the existing caller behavior.Timestamp formatting now handles rounding to
86400seconds by carrying to the next day.Note
I am using
jetdbin a personal desktop application that needs to read Microsoft Access databases, and it has been genuinely useful for that use case. It is a pity that the project is not more widely known, because a pure Rust Access reader fills a very practical gap.Relation to #8
This partially overlaps with #8 in
crack_row_jet4. That PR prevents the debug overflow panic by keepingwrapping_suband making the bounds check panic-safe withchecked_add. This PR instead avoids the wrap at the subtraction step withchecked_sub, and keeps the same intended behavior of stopping the offset-table scan when the declared variable-column count extends before the row start.Tests
scripts/quality-check.sh