[PR #610] [MERGED] Bugfix for TarWriter - too much padding in large files #1123

Open
opened 2026-01-29 22:19:06 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/610
Author: @cyr
Created: 8/27/2021
Status: Merged
Merged: 9/12/2021
Merged by: @adamhathcock

Base: masterHead: master


📝 Commits (2)

  • 1b661c9 Fixed bug where large (int32+ file size) adds an additional 512 bytes of padding in tar files.
  • 61802ea Merge branch 'adamhathcock:master' into master

📊 Changes

1 file changed (+6 additions, -10 deletions)

View changed files

📝 src/SharpCompress/Writers/Tar/TarWriter.cs (+6 -10)

📄 Description

For large files, due to how the padding was calculated an additional 512 bytes was added. I noticed this while archiving a file (size 11721453867 bytes, i.e. 11gb, roughly) and 725 null bytes were added as padding, instead of 213. This new method calculates large sizes correctly (and is faster!).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/610 **Author:** [@cyr](https://github.com/cyr) **Created:** 8/27/2021 **Status:** ✅ Merged **Merged:** 9/12/2021 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`1b661c9`](https://github.com/adamhathcock/sharpcompress/commit/1b661c9df197c2d63281a73418ba7cd8762da7e6) Fixed bug where large (int32+ file size) adds an additional 512 bytes of padding in tar files. - [`61802ea`](https://github.com/adamhathcock/sharpcompress/commit/61802eadb44e6f7f57e30a105eb426fe583cfa17) Merge branch 'adamhathcock:master' into master ### 📊 Changes **1 file changed** (+6 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Writers/Tar/TarWriter.cs` (+6 -10) </details> ### 📄 Description For large files, due to how the padding was calculated an additional 512 bytes was added. I noticed this while archiving a file (size 11721453867 bytes, i.e. 11gb, roughly) and 725 null bytes were added as padding, instead of 213. This new method calculates large sizes correctly (and is faster!). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:19:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1123