Skip to content

kwsparse: Reject unrepresentable disk and block sizes - #91

Open
dagelf wants to merge 1 commit into
pithings:mainfrom
dagelf:kwsparse-geometry
Open

dagelf wants to merge 1 commit into
pithings:mainfrom
dagelf:kwsparse-geometry

Conversation

@dagelf

@dagelf dagelf commented Nov 29, 2026

Copy link
Copy Markdown

Use the same size checks when encoding and decoding sparse images. Reject disk sizes that cannot be represented exactly in JavaScript and block sizes that cannot be represented by the format. Count aligned 32-bit words without coercing the byte length to a signed 32-bit integer.

The regression covers an oversized on-disk size, a negative size, and a block size that would wrap in the header.

Verification

TypeScript and the full block test suite passed on this branch.

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.

1 participant