ProxyTrack still copies through raw strcpy in fourteen places#743
Merged
Conversation
Fourteen sites, all safe today: literals into sized fields, and two same-sized array copies. The three writing "" through r->location, a char *, become a direct terminator, since strcpybuff would have taken its pointer path and lost the bound. Co-Authored-By: Claude Opus 5 (1M context) <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.
Fourteen raw
strcpycalls left inproxy/store.candproxy/proxytrack.c, all safe today but none of them saying so: string literals into sized struct fields, and two copies between same-sized arrays.Three of them write
""throughr->location, which is achar *, not an array. Those become a direct[0] = '\0'rather thanstrcpybuff, because the macro would have silently taken its pointer path and lost the bound it exists to provide.One
strcpyin the same file is deliberately left for a follow-up:previous_save_in the cache-1.0 reader takes the decoded request URL, which wants the clipping helper from #741 rather than an aborting wrapper. It is not reachable with an over-long URL today, sincecoucal_readrequires the URL to already be a key in the cache, so its length is whatever wrote the cache.