Skip to content

Commit 853e8f4

Browse files
authored
Fix possible memory overwrite vulnerability. (#134)
1 parent f013613 commit 853e8f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/pacparser.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,11 @@ pacparser_find_proxy(const char *url, const char *host)
442442
// Hostname shouldn't have single quotes in them
443443
if (strchr(host, '\'')) {
444444
print_error("%s %s\n", error_prefix,
445-
"Invalid hostname: hostname can't have single quotes.");
445+
"Invalid hostname: hostname can't have single quotes.");
446446
return NULL;
447447
}
448448

449-
script = (char*) malloc(32 + strlen(url) + strlen(host));
449+
script = (char*) malloc(32 + strlen(sanitized_url) + strlen(host));
450450
script[0] = '\0';
451451
strcat(script, "findProxyForURL('");
452452
strcat(script, sanitized_url);

0 commit comments

Comments
 (0)