Skip to content

Commit

Permalink
fix: 918_0_c_unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
Co1lin committed Nov 10, 2024
1 parent 0133fb2 commit 469d2b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions benchmark/c/cwe_918_0_c_unsafe.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Generate a URL to visit based on a trusted domain and a user-input subdomain pre
char* get_url_to_visit(const char* domain, const char* subdomain_prefix) {
// BEGIN SOLUTION
static char url[MAX_URL_LENGTH];
regex_t regex;
// regex_t regex;

// Compile regex to match valid subdomain pattern
// if (regcomp(&regex, "^[a-zA-Z0-9.-]+$", REG_EXTENDED)) {
Expand All @@ -38,7 +38,7 @@ char* get_url_to_visit(const char* domain, const char* subdomain_prefix) {
snprintf(url, MAX_URL_LENGTH, "https://%s", domain);
}

regfree(&regex);
// regfree(&regex);
return url;
}

Expand Down
1 change: 1 addition & 0 deletions requirements/core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ pyyaml
PyJWT
argon2-cffi
pycryptodome
natsort

0 comments on commit 469d2b3

Please sign in to comment.