Skip to content

chore: replace zip file reader to io reader#56

Merged
Mayuresh Pawar (Mayureshpawar29) merged 2 commits intomainfrom
hotfix-zip-file-reader
Apr 3, 2026
Merged

chore: replace zip file reader to io reader#56
Mayuresh Pawar (Mayureshpawar29) merged 2 commits intomainfrom
hotfix-zip-file-reader

Conversation

@ma-gk
Copy link
Copy Markdown
Contributor

Description

Replaced fs.Read(buf) with io.ReadFull(fs, buf) in the zip archive unpack (Read) function.

Go's io.Reader.Read() is not guaranteed to fill the entire buffer in a single call — it may return fewer bytes than requested even before EOF. For large files inside a ZIP archive, this results in truncated/partial data padded with null bytes.

io.ReadFull loops internally until exactly len(buf) bytes are read, ensuring complete data extraction.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation and I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@Mayureshpawar29 Mayuresh Pawar (Mayureshpawar29) merged commit caf7de7 into main Apr 3, 2026
7 checks passed
@Mayureshpawar29 Mayuresh Pawar (Mayureshpawar29) deleted the hotfix-zip-file-reader branch April 3, 2026 11:54
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.

2 participants