From 469d2b39a6015c04ea904d6bc57552b0ddef25f7 Mon Sep 17 00:00:00 2001 From: Co1lin Date: Sat, 9 Nov 2024 20:58:10 -0500 Subject: [PATCH] fix: 918_0_c_unsafe --- benchmark/c/cwe_918_0_c_unsafe.c | 4 ++-- requirements/core.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/benchmark/c/cwe_918_0_c_unsafe.c b/benchmark/c/cwe_918_0_c_unsafe.c index 44723c4..fbb81c6 100644 --- a/benchmark/c/cwe_918_0_c_unsafe.c +++ b/benchmark/c/cwe_918_0_c_unsafe.c @@ -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(®ex, "^[a-zA-Z0-9.-]+$", REG_EXTENDED)) { @@ -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(®ex); + // regfree(®ex); return url; } diff --git a/requirements/core.txt b/requirements/core.txt index 6d8fb8b..0d6f34a 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -8,3 +8,4 @@ pyyaml PyJWT argon2-cffi pycryptodome +natsort