mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-21 22:19:29 +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,65 @@
|
||||
/* Provenance: curl/curl Curl_open (fixed).
|
||||
* repo: curl/curl
|
||||
* commit: 3c9e021f86872baae412a427e807fbfa2f3e8a22
|
||||
* parent: 687908c6e6332b2bf4ba74b271e795f9c65a5a61
|
||||
* commit_url: https://github.com/curl/curl/commit/3c9e021f86872baae412a427e807fbfa2f3e8a22
|
||||
* cve: CVE-2020-8231
|
||||
* license: curl
|
||||
* function: Curl_open
|
||||
* relpath: lib/url.c
|
||||
*/
|
||||
|
||||
* Curl_open()
|
||||
*
|
||||
* @param curl is a pointer to a sessionhandle pointer that gets set by this
|
||||
* function.
|
||||
* @return CURLcode
|
||||
*/
|
||||
|
||||
CURLcode Curl_open(struct Curl_easy **curl)
|
||||
{
|
||||
CURLcode result;
|
||||
struct Curl_easy *data;
|
||||
|
||||
/* Very simple start-up: alloc the struct, init it with zeroes and return */
|
||||
data = calloc(1, sizeof(struct Curl_easy));
|
||||
if(!data) {
|
||||
/* this is a very serious error */
|
||||
DEBUGF(fprintf(stderr, "Error: calloc of Curl_easy failed\n"));
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
data->magic = CURLEASY_MAGIC_NUMBER;
|
||||
|
||||
result = Curl_resolver_init(data, &data->state.resolver);
|
||||
if(result) {
|
||||
DEBUGF(fprintf(stderr, "Error: resolver_init failed\n"));
|
||||
free(data);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = Curl_init_userdefined(data);
|
||||
if(!result) {
|
||||
Curl_dyn_init(&data->state.headerb, CURL_MAX_HTTP_HEADER);
|
||||
Curl_convert_init(data);
|
||||
Curl_initinfo(data);
|
||||
|
||||
/* most recent connection is not yet defined */
|
||||
data->state.lastconnect_id = -1;
|
||||
|
||||
data->progress.flags |= PGRS_HIDE;
|
||||
data->state.current_speed = -1; /* init to negative == impossible */
|
||||
}
|
||||
|
||||
if(result) {
|
||||
Curl_resolver_cleanup(data->state.resolver);
|
||||
Curl_dyn_free(&data->state.headerb);
|
||||
Curl_freeset(data);
|
||||
free(data);
|
||||
data = NULL;
|
||||
}
|
||||
else
|
||||
*curl = data;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/* Provenance: curl/curl Curl_open (vuln).
|
||||
* repo: curl/curl
|
||||
* commit: 687908c6e6332b2bf4ba74b271e795f9c65a5a61
|
||||
* parent: 687908c6e6332b2bf4ba74b271e795f9c65a5a61
|
||||
* commit_url: https://github.com/curl/curl/commit/3c9e021f86872baae412a427e807fbfa2f3e8a22
|
||||
* cve: CVE-2020-8231
|
||||
* license: curl
|
||||
* function: Curl_open
|
||||
* relpath: lib/url.c
|
||||
*/
|
||||
|
||||
* Curl_open()
|
||||
*
|
||||
* @param curl is a pointer to a sessionhandle pointer that gets set by this
|
||||
* function.
|
||||
* @return CURLcode
|
||||
*/
|
||||
|
||||
CURLcode Curl_open(struct Curl_easy **curl)
|
||||
{
|
||||
CURLcode result;
|
||||
struct Curl_easy *data;
|
||||
|
||||
/* Very simple start-up: alloc the struct, init it with zeroes and return */
|
||||
data = calloc(1, sizeof(struct Curl_easy));
|
||||
if(!data) {
|
||||
/* this is a very serious error */
|
||||
DEBUGF(fprintf(stderr, "Error: calloc of Curl_easy failed\n"));
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
data->magic = CURLEASY_MAGIC_NUMBER;
|
||||
|
||||
result = Curl_resolver_init(data, &data->state.resolver);
|
||||
if(result) {
|
||||
DEBUGF(fprintf(stderr, "Error: resolver_init failed\n"));
|
||||
free(data);
|
||||
return result;
|
||||
}
|
||||
|
||||
result = Curl_init_userdefined(data);
|
||||
if(!result) {
|
||||
Curl_dyn_init(&data->state.headerb, CURL_MAX_HTTP_HEADER);
|
||||
Curl_convert_init(data);
|
||||
Curl_initinfo(data);
|
||||
|
||||
/* most recent connection is not yet defined */
|
||||
data->state.lastconnect = NULL;
|
||||
|
||||
data->progress.flags |= PGRS_HIDE;
|
||||
data->state.current_speed = -1; /* init to negative == impossible */
|
||||
}
|
||||
|
||||
if(result) {
|
||||
Curl_resolver_cleanup(data->state.resolver);
|
||||
Curl_dyn_free(&data->state.headerb);
|
||||
Curl_freeset(data);
|
||||
free(data);
|
||||
data = NULL;
|
||||
}
|
||||
else
|
||||
*curl = data;
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user