mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-20 21:49:28 +00:00
feat(real-world-vfc-slice): add labeled OpenSSL/Firefox/Chromium/curl pair corpus
Harvest 176 isolated vuln-vs-fix functions (109 CVEs, 352 training rows) into benchmarks/pairs/vfc with provenance and a JSONL training manifest. Score the slice as an honesty dashboard (ousast pairs --slice vfc); keep the pair gate on the local fixtures only.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
/* Provenance: openssl/openssl use_proxy (fixed).
|
||||
* repo: openssl/openssl
|
||||
* commit: 654dc11d23468a74fc8ea4672b702dd3feb7be4b
|
||||
* parent: a79c4ce559c6a3a8fd4109e9f33c1185d5bf2def
|
||||
* commit_url: https://github.com/openssl/openssl/commit/654dc11d23468a74fc8ea4672b702dd3feb7be4b
|
||||
* cve: CVE-2025-9232
|
||||
* license: Apache-2.0
|
||||
* function: use_proxy
|
||||
* relpath: crypto/http/http_lib.c
|
||||
*/
|
||||
|
||||
static int use_proxy(const char *no_proxy, const char *server)
|
||||
{
|
||||
size_t sl;
|
||||
const char *found = NULL;
|
||||
char host[NI_MAXHOST];
|
||||
|
||||
if (!ossl_assert(server != NULL))
|
||||
return 0;
|
||||
sl = strlen(server);
|
||||
if (sl >= 2 && sl < sizeof(host) + 2 && server[0] == '[' && server[sl - 1] == ']') {
|
||||
/* strip leading '[' and trailing ']' from escaped IPv6 address */
|
||||
sl -= 2;
|
||||
strncpy(host, server + 1, sl);
|
||||
host[sl] = '\0';
|
||||
server = host;
|
||||
}
|
||||
|
||||
/*
|
||||
* using environment variable names, both lowercase and uppercase variants,
|
||||
* compatible with other HTTP client implementations like wget, curl and git
|
||||
*/
|
||||
if (no_proxy == NULL)
|
||||
no_proxy = ossl_safe_getenv("no_proxy");
|
||||
if (no_proxy == NULL)
|
||||
no_proxy = ossl_safe_getenv(OPENSSL_NO_PROXY);
|
||||
|
||||
if (no_proxy != NULL)
|
||||
found = strstr(no_proxy, server);
|
||||
while (found != NULL
|
||||
&& ((found != no_proxy && !ossl_isspace(found[-1]) && found[-1] != ',')
|
||||
|| (found[sl] != '\0' && !ossl_isspace(found[sl]) && found[sl] != ',')))
|
||||
found = strstr(found + 1, server);
|
||||
return found == NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user