Skip to content

Appending to zip file with non-UTF-8 filenames corrupts the central directory #364

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

amazon-q-developer[bot]
Copy link

Pull request for Appending to zip file with non-UTF-8 filenames corrupts the central directory

Copy link
Author

Resolves #361

Copy link
Author

To provide feedback, navigate to the Files changed tab and leave comments on the proposed code changes. Choose Start review for each comment, and then choose Request changes, and I'll propose revised changes.

Copy link
Author

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

Copy link
Author

✅ I finished the code review, and didn't find any security or code quality issues.

@@ -0,0 +1,18 @@
// This is a temporary file to show the fix
// The fix is in the flags() method of ZipFileData

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the existing flags method instead of creating this new file.

self.start_file(&name, options)?;

// Access the last file entry and replace the filename_raw
if let Some((_name, file_data)) = self.files.last_mut() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return an error if this is None.

Copy link
Author

⏳ I'm generating code changes based on the feedback. I'll update this pull request when I'm done.

1 similar comment
Copy link
Author

⏳ I'm generating code changes based on the feedback. I'll update this pull request when I'm done.

@Pr0methean Pr0methean added the Amazon Q development agent Generate new features or iterate code based on issue descriptions and comments. label Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Amazon Q development agent Generate new features or iterate code based on issue descriptions and comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant