Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dont exceed buffer boundaries, when the buffer is empty #16664

Merged
merged 1 commit into from Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 3 additions & 6 deletions web/server/web_client.c
Expand Up @@ -79,14 +79,11 @@ static inline int web_client_uncork_socket(struct web_client *w __maybe_unused)
return 0;
}

char *strip_control_characters(char *url) {
char *s = url;
if(!s) return "";
static inline char *strip_control_characters(char *url) {
if(!url) return "";

if(iscntrl(*s)) *s = ' ';
while(*++s) {
for(char *s = url; *s ;s++)
if(iscntrl(*s)) *s = ' ';
}

return url;
}
Expand Down
1 change: 0 additions & 1 deletion web/server/web_client.h
Expand Up @@ -208,7 +208,6 @@ void web_client_request_done(struct web_client *w);
void buffer_data_options2string(BUFFER *wb, uint32_t options);

void web_client_build_http_header(struct web_client *w);
char *strip_control_characters(char *url);

void web_client_reuse_from_cache(struct web_client *w);
struct web_client *web_client_create(size_t *statistics_memory_accounting);
Expand Down