Skip to content

Fix native zip parsing alignment crash - #167

Open
ITJesse wants to merge 1 commit into
john-rocky:mainfrom
ITJesse:fix-native-zip-misaligned-load
Open

ITJesse wants to merge 1 commit into
john-rocky:mainfrom
ITJesse:fix-native-zip-misaligned-load

Conversation

@ITJesse

@ITJesse ITJesse commented May 13, 2026

Copy link
Copy Markdown

Summary

Fixes a crash in the native ZIP extractor used on non-macOS platforms. The extractor was reading UInt16/UInt32 values from Data slices with withUnsafeBytes { $0.load(as:) }. Those slices are not guaranteed to be aligned, so Swift can trap with:

Swift/UnsafeRawPointer.swift: Fatal error: load from misaligned raw pointer

This replaces those reads with explicit little-endian byte decoding.

Validation

  • swift build

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.

1 participant