Files
Open_Ultra_SAST/benchmarks/pairs/vfc/curl-cve-2022-32208/vuln.c
T
Marius Ciepluch 0116f9bea6 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.
2026-09-04 16:45:38 +02:00

39 lines
1.0 KiB
C

/* Provenance: curl/curl read_data (vuln).
* repo: curl/curl
* commit: 2b67a0a1129b20a56ed04859fec8999f5c0c4280
* parent: 2b67a0a1129b20a56ed04859fec8999f5c0c4280
* commit_url: https://github.com/curl/curl/commit/6ecdf5136b52af747e7bda08db9a748256b1cd09
* cve: CVE-2022-32208
* license: curl
* function: read_data
* relpath: lib/krb5.c
*/
static CURLcode read_data(struct connectdata *conn,
curl_socket_t fd,
struct krb5buffer *buf)
{
int len;
CURLcode result;
result = socket_read(fd, &len, sizeof(len));
if(result)
return result;
if(len) {
/* only realloc if there was a length */
len = ntohl(len);
buf->data = Curl_saferealloc(buf->data, len);
}
if(!len || !buf->data)
return CURLE_OUT_OF_MEMORY;
result = socket_read(fd, buf->data, len);
if(result)
return result;
buf->size = conn->mech->decode(conn->app_data, buf->data, len,
conn->data_prot, conn);
buf->index = 0;
return CURLE_OK;
}