Skip to content

Commit

Permalink
Fix possible memory overwrite vulnerability. (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
manugarg authored Apr 13, 2022
1 parent f013613 commit 853e8f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pacparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,11 @@ pacparser_find_proxy(const char *url, const char *host)
// Hostname shouldn't have single quotes in them
if (strchr(host, '\'')) {
print_error("%s %s\n", error_prefix,
"Invalid hostname: hostname can't have single quotes.");
"Invalid hostname: hostname can't have single quotes.");
return NULL;
}

script = (char*) malloc(32 + strlen(url) + strlen(host));
script = (char*) malloc(32 + strlen(sanitized_url) + strlen(host));
script[0] = '\0';
strcat(script, "findProxyForURL('");
strcat(script, sanitized_url);
Expand Down

0 comments on commit 853e8f4

Please sign in to comment.