mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-21 14:09:27 +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 append_ia5 (fixed).
|
||||
* repo: openssl/openssl
|
||||
* commit: 98624776c4d501c8badd6f772ab7048ac9191cb9
|
||||
* parent: 1f365708a3318a5f1a395f90c38b584a58d37fb9
|
||||
* commit_url: https://github.com/openssl/openssl/commit/98624776c4d501c8badd6f772ab7048ac9191cb9
|
||||
* cve: CVE-2021-3712
|
||||
* license: OpenSSL License
|
||||
* function: append_ia5
|
||||
* relpath: crypto/x509/v3_utl.c
|
||||
*/
|
||||
|
||||
static int append_ia5(STACK_OF(OPENSSL_STRING) **sk,
|
||||
const ASN1_IA5STRING *email)
|
||||
{
|
||||
char *emtmp;
|
||||
|
||||
/* First some sanity checks */
|
||||
if (email->type != V_ASN1_IA5STRING)
|
||||
return 1;
|
||||
if (email->data == NULL || email->length == 0)
|
||||
return 1;
|
||||
if (memchr(email->data, 0, email->length) != NULL)
|
||||
return 1;
|
||||
if (*sk == NULL)
|
||||
*sk = sk_OPENSSL_STRING_new(sk_strcmp);
|
||||
if (*sk == NULL)
|
||||
return 0;
|
||||
|
||||
emtmp = OPENSSL_strndup((char *)email->data, email->length);
|
||||
if (emtmp == NULL)
|
||||
return 0;
|
||||
|
||||
/* Don't add duplicates */
|
||||
if (sk_OPENSSL_STRING_find(*sk, emtmp) != -1) {
|
||||
OPENSSL_free(emtmp);
|
||||
return 1;
|
||||
}
|
||||
if (!sk_OPENSSL_STRING_push(*sk, emtmp)) {
|
||||
OPENSSL_free(emtmp); /* free on push failure */
|
||||
X509_email_free(*sk);
|
||||
*sk = NULL;
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/* Provenance: openssl/openssl append_ia5 (vuln).
|
||||
* repo: openssl/openssl
|
||||
* commit: 1f365708a3318a5f1a395f90c38b584a58d37fb9
|
||||
* parent: 1f365708a3318a5f1a395f90c38b584a58d37fb9
|
||||
* commit_url: https://github.com/openssl/openssl/commit/98624776c4d501c8badd6f772ab7048ac9191cb9
|
||||
* cve: CVE-2021-3712
|
||||
* license: OpenSSL License
|
||||
* function: append_ia5
|
||||
* relpath: crypto/x509/v3_utl.c
|
||||
*/
|
||||
|
||||
static int append_ia5(STACK_OF(OPENSSL_STRING) **sk,
|
||||
const ASN1_IA5STRING *email)
|
||||
{
|
||||
char *emtmp;
|
||||
|
||||
/* First some sanity checks */
|
||||
if (email->type != V_ASN1_IA5STRING)
|
||||
return 1;
|
||||
if (!email->data || !email->length)
|
||||
return 1;
|
||||
if (*sk == NULL)
|
||||
*sk = sk_OPENSSL_STRING_new(sk_strcmp);
|
||||
if (*sk == NULL)
|
||||
return 0;
|
||||
/* Don't add duplicates */
|
||||
if (sk_OPENSSL_STRING_find(*sk, (char *)email->data) != -1)
|
||||
return 1;
|
||||
emtmp = OPENSSL_strdup((char *)email->data);
|
||||
if (emtmp == NULL || !sk_OPENSSL_STRING_push(*sk, emtmp)) {
|
||||
OPENSSL_free(emtmp); /* free on push failure */
|
||||
X509_email_free(*sk);
|
||||
*sk = NULL;
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user