mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-18 20:49:28 +00:00
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.
37 lines
1001 B
C
37 lines
1001 B
C
/* Provenance: openssl/openssl ia5ncasecmp (fixed).
|
|
* repo: openssl/openssl
|
|
* commit: d2015a783e64613d8e4a142fa05048d1863df944
|
|
* parent: 918430ba80d94ec8f05383b43b1872b1ebb13e1a
|
|
* commit_url: https://github.com/openssl/openssl/commit/d2015a783e64613d8e4a142fa05048d1863df944
|
|
* cve: CVE-2021-3712
|
|
* license: OpenSSL License
|
|
* function: ia5ncasecmp
|
|
* relpath: crypto/x509/v3_ncons.c
|
|
*/
|
|
|
|
static int ia5ncasecmp(const char *s1, const char *s2, size_t n)
|
|
{
|
|
for (; n > 0; n--, s1++, s2++) {
|
|
if (*s1 != *s2) {
|
|
unsigned char c1 = (unsigned char)*s1, c2 = (unsigned char)*s2;
|
|
|
|
/* Convert to lower case */
|
|
if (c1 >= 0x41 /* A */ && c1 <= 0x5A /* Z */)
|
|
c1 += 0x20;
|
|
if (c2 >= 0x41 /* A */ && c2 <= 0x5A /* Z */)
|
|
c2 += 0x20;
|
|
|
|
if (c1 == c2)
|
|
continue;
|
|
|
|
if (c1 < c2)
|
|
return -1;
|
|
|
|
/* c1 > c2 */
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|