Skip to content

ProxyTrack still copies through raw strcpy in fourteen places#743

Merged
xroche merged 2 commits into
masterfrom
fix/storestrcpy
Jul 26, 2026
Merged

ProxyTrack still copies through raw strcpy in fourteen places#743
xroche merged 2 commits into
masterfrom
fix/storestrcpy

Conversation

@xroche

@xroche xroche commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Fourteen raw strcpy calls left in proxy/store.c and proxy/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 "" through r->location, which is a char *, not an array. Those become a direct [0] = '\0' rather than strcpybuff, because the macro would have silently taken its pointer path and lost the bound it exists to provide.

One strcpy in 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, since coucal_read requires the URL to already be a key in the cache, so its length is whatever wrote the cache.

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>
@xroche
xroche merged commit b2dc012 into master Jul 26, 2026
22 checks passed
@xroche
xroche deleted the fix/storestrcpy branch July 26, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant