Skip to content

fix(puffin): add missing magic number validation for puffins#2416

Open
dentiny wants to merge 1 commit intoapache:mainfrom
dentiny:hjiang/add-missing-puffin-validation
Open

fix(puffin): add missing magic number validation for puffins#2416
dentiny wants to merge 1 commit intoapache:mainfrom
dentiny:hjiang/add-missing-puffin-validation

Conversation

@dentiny
Copy link
Copy Markdown
Contributor

@dentiny dentiny commented May 9, 2026

What changes are included in this PR?

We have two functions to read puffin metadata: read and read_with_prefetch. In theory these two functions should be similarly the same apart from IO-related logic, but read_with_prefetch seems to miss magic number validation:

FileMetadata::check_magic(&first_four_bytes)?;

In terms of implementation, I thought about extracting validation+footer parse into a separate function, but the code is very simple here, don't think it necessary.

Are these changes tested?

Yes, the newly added regression test fails for the current codebase

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