Skip to content

Fix SQLite3 Cell data overflow reading for databases with header.reserved_size set - #25

Merged
Schamper merged 5 commits into
fox-it:mainfrom
JSCU-CNI:sqlite-fix-cell-data-overflow-reading
Feb 6, 2026
Merged

Schamper merged 5 commits into
fox-it:mainfrom
JSCU-CNI:sqlite-fix-cell-data-overflow-reading

Conversation

@JSCU-CNI

@JSCU-CNI JSCU-CNI commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

This PR fixes Cell.data reading for databases when parsing a cell value larger than the (usable) page size. Currently the overflow page lookup implementation does not calculate the data_size correctly for databases with header.reserved_size set.

@Schamper

Schamper commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

You know the question that's coming: is it possible to have some test data for this edge case?

Also @PimSanders since you've been looking into SQLite for a little while now, what are your thoughts on this?

@JSCU-CNI

JSCU-CNI commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

You know the question that's coming: is it possible to have some test data for this edge case?

The PR for #17 will include test data that covers this change.

@JSCU-CNI

JSCU-CNI commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

Added a separate test for this case in 3a09e78.

@PimSanders

Copy link
Copy Markdown
Contributor

I think I understand where this issue comes from and how the fix works. Seems to me like a good fix for the issue.

Only thing I noticed is that self.page.sqlite.usable_page_size is the same as self.sqlite.usable_page_size, which might make the code a tiny bit more readable.

Haven't been able to test it yet, so correct me if I'm wrong.

Schamper
Schamper previously approved these changes Feb 6, 2026
@codecov

codecov Bot commented Feb 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (f75cabe) to head (7c44bf1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dissect/database/sqlite3/sqlite3.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main     #25   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        146     146           
  Lines       3880    3879    -1     
=====================================
+ Misses      3880    3879    -1     
Flag Coverage Δ
unittests 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Schamper Schamper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TIL ruff lints Python inside docstrings.

@Schamper
Schamper merged commit e05997f into fox-it:main Feb 6, 2026
21 checks passed
@codspeed

codspeed Bot commented Feb 6, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing JSCU-CNI:sqlite-fix-cell-data-overflow-reading (7c44bf1) with main (f75cabe)

Open in CodSpeed

twiggler pushed a commit to twiggler/dissect-monorepo-test that referenced this pull request May 26, 2026
…erved_size` set (fox-it/dissect.database#25)

Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
twiggler pushed a commit to twiggler/dissect-monorepo-test that referenced this pull request Jun 4, 2026
…erved_size` set (fox-it/dissect.database#25)

Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
twiggler pushed a commit to twiggler/dissect-monorepo-test that referenced this pull request Jun 5, 2026
…erved_size` set (fox-it/dissect.database#25)

Co-authored-by: Erik Schamper <1254028+Schamper@users.noreply.github.com>
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.

3 participants