Skip to content

Conversation

@ndossche
Copy link
Member

Still a PoC

@ndossche ndossche marked this pull request as ready for review October 24, 2025 19:53
@ndossche ndossche requested a review from Girgias October 24, 2025 19:53
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

I think this is correct from reading the spec and the code. I don't really know tar, so I didn't attempt to craft something that might break.

It might be an idea to expose this to some sort of fuzzer?

Copy link
Member

Choose a reason for hiding this comment

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

Possibly move where the bail: label is? It is somewhat confusing that we go "back up" to do error handling rather than the usual "go to end of function" style for error handling. As I needed to look up the full function code to locate the label.

May be a follow-up PR/commit or be a new commit in this change set.

goto next;
/* Process global/file pax header: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/pax.html */
if (!old && hdr->typeflag == TAR_GLOBAL_HDR) {
size = (size + 511) & ~511;
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain what this line does actually?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected path truncation of files contained in a tar file by PharData::extractTo()

2 participants