Repository navigation
Conversation
ProxyTrack's new.zip index walk passed no unz_file_info to minizip and used a 4096-byte name buffer, so a longer entry name came back clipped and unterminated, and indexed under a key that was not its name. Two long names could then collapse onto one clipped key. Use the engine's rule: a CACHE_ENTRYNAME_SIZE buffer, and reject a name whose size_filename does not fit, as a corrupted entry. Match http:// and X-In-Cache like the engine does, without regard to case, in the zip walk and the ARC walk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
Move CACHE_KEY_SIZE and CACHE_ENTRYNAME_SIZE above the internal-only block of htscache.h, so ProxyTrack uses the engine's constant instead of a copied literal. Put back the case-sensitive http:// match in the ARC walk. That walk drops a record whose scheme fails PT_CompatibleScheme, which is case-sensitive, so the change there had no effect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
The zip read path takes the absolute index position and parses X-In-Cache again from the entry's own header, so the sign this match sets is never read. Making it ignore case changed nothing a test could see, so it does not belong in this PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ProxyTrack now reads a cache zip with the same entry-name rule as the engine. It keeps names up to 4101 bytes whole and drops longer ones as a corrupted entry. Before, it indexed them under a name clipped at 4094 bytes, which minizip also left without a terminating NUL. The zip walk also strips
http://without regard to case.The name buffer is now the engine's
CACHE_ENTRYNAME_SIZE, whichhtscache.hdefines outside its internal-only block so that ProxyTrack can use it. Without that size, the check would drop names of 4094 to 4101 bytes that the engine keeps.Test 748 converts a crafted zip and fails on master, where it gets 5 index keys instead of 3. It also fails with the size check removed and with the case-sensitive
http://match put back.