Conversation
Summary of ChangesHello @Its-Just-Nans, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where the ZIP parser could incorrectly report errors when encountering malformed or truncated extra fields, particularly those that might be padding. The changes introduce more sophisticated logic to distinguish between known extra fields and unknown ones, allowing the parser to gracefully skip over truncated unknown fields while providing more informative errors for known ones. This improves the robustness of the ZIP reader when dealing with non-standard or partially written extra field data. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
The changes improve extra field parsing by handling padding more gracefully while maintaining strict validation for known fields. The implementation correctly differentiates between known and unknown extra fields, treating truncated unknown fields as padding (per the ZIP specification's allowance for padding) while still enforcing proper structure for known fields. The refactoring in src/extra_fields/mod.rs improves code organization. No defects found that would block merge.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
There was a problem hiding this comment.
Code Review
This pull request aims to improve handling of extra field padding by being more lenient when reading unknown extra field lengths, preventing archive read failures due to trailing garbage. However, the proposed changes introduce a critical infinite loop vulnerability in src/read.rs when processing malformed ZIP files with truncated extra field headers, potentially leading to a Denial of Service (DoS) by causing 100% CPU usage. While addressing the padding issue, it's crucial to ensure the parser always makes progress or terminates gracefully with truncated data. Additionally, there are minor improvements suggested for better error reporting and more robust error handling.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: n4n5 <git@n4n5.dev>
|
Could you cancel the merge I think I can improve it a little bit by removing the |
|
Canceled. |
Thanks I will add test(s) on this pull request soon |
Pr0methean
left a comment
There was a problem hiding this comment.
Looks good; just a few nitpicks about the test.
fix: #681
Need to check if we handle it even if it looks like not from the specs