-
Notifications
You must be signed in to change notification settings - Fork 621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tar): ignore non-tar file portion of a stream in UntarStream
#6064
Conversation
… be exactly the right amount of bytes - The spec specifies that a tar file ends with 1024 bytes of `0b00`, but it says nothing about extra information being stored after this.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6064 +/- ##
=======================================
Coverage 96.75% 96.76%
=======================================
Files 508 508
Lines 39132 39140 +8
Branches 5786 5793 +7
=======================================
+ Hits 37864 37872 +8
Misses 1226 1226
Partials 42 42 ☔ View full report in Codecov by Sentry. |
UntarStream
bugUntarStream
UntarStream
UntarStream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes: denoland/wasmbuild#143
This pull request fixes a bug with the
UntarStream
class where it incorrectly assumes the contents of a stream will only contain a tar file. This is incorrect as anything after a tar file can be appended and a valid tar decoder should ignore everything after it receives its 1024 bytes of0b00
when checking for a header.The changes made here should check for a premature ending and if so send a cancel signal upstream so if a readable stream being pipped in intentionally had multiple stuff appended together, it can listen for that and then switch to whatever.