-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg: hardening: slurp trailing bytes in VerifiedReadCloser.Close()
This is to ensure that we handle both good and bad cases sanely -- namely, that we always are digesting the *full* blob when Close() is called. This avoids us producing intermittent errors if blobs have extra trailing bytes (such as garbage at the end of a gzip stream), as well as hardening us against incorrect digests (though it should be noted this case cannot be triggered without disabling size verification -- the size verficiation we have already blocks this issue). Signed-off-by: Aleksa Sarai <[email protected]>
- Loading branch information
Showing
2 changed files
with
106 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters