feat: improve and fix extended timestamp extra field parsing#713
feat: improve and fix extended timestamp extra field parsing#713Its-Just-Nans merged 14 commits intomasterfrom
Conversation
Summary of ChangesHello, 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 significantly improves the parsing of extended timestamps by introducing a more structured approach to flag handling and enhancing error detection. The changes ensure that the system gracefully handles malformed or incomplete timestamp data, preventing crashes and making the parsing logic more resilient and reliable. Highlights
Changelog
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.
This PR improves extended timestamp handling by adding overflow protection and refactoring flag checks. However, there's a critical logic error in the matching method (line 26) that prevents access time and creation time from being parsed correctly. The bitwise AND comparison checks for equality with 1, but AcTime and CrTime flags have values 2 and 4 respectively, causing these fields to always be skipped.
Critical issue:
- Line 26: Fix bitwise comparison to check
!= 0instead of== 1
Once this is fixed, the overflow protection and test coverage additions are solid improvements.
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 improves robustness in parsing extended timestamps. The review identified a significant logic error in ExtendedTimestampFlags::matching that could lead to data integrity issues or security vulnerabilities due to incorrect bitmask validation. Additionally, an error message was found to be misleading, and a more accurate one is suggested. The PR also introduces ExtendedTimestampFlags for clarity and other minor improvements.
|
Note I can still improve the code Edit: done |
|
btw i think this condition (which is forcing the modTime when len == 5) was incorrect |
Pr0methean
left a comment
There was a problem hiding this comment.
Could you please explain in the title what specific improvements this gives us from the user's perspective? Remember, a PR title is its CHANGELOG entry.
Co-authored-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Signed-off-by: n4n5 <git@n4n5.dev>
…to extended-timestamp-checks
Pr0methean
left a comment
There was a problem hiding this comment.
One nitpick re naming convention; otherwise looks good.
Dismissing the review (now fixed) to be able to merge
An improvement over https://github.com/zip-rs/zip2/pull/697/changes