{"target_id": "cups:merged:src/cups/cups/ppd-cache.c:1483", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "cups", "harness": "merged", "harness_binaries": "[\"fuzz_array\", \"fuzz_cups\", \"fuzz_http_core\", \"fuzz_ipp\", \"fuzz_ipp_gen\", \"fuzz_ppd_gen_1\", \"fuzz_ppd_gen_cache\", \"fuzz_ppd_gen_conflicts\", \"fuzz_raster\"]", "language": "c", "file": "/src/cups/cups/ppd-cache.c", "line_start": 1483, "line_end": 1483, "line_count": 1, "function": "", "source_snippet": " 1383 | {\"Preprint\", 8, \"stationery-preprinted\"},\n 1384 | {\"Recycled\", -1, \"stationery-recycled\"},\n 1385 | {\"Transparen\", 10, \"transparency\"},\n 1386 | };\n 1387 | const int num_standard_types = (int)(sizeof(standard_types) / sizeof(standard_types[0]));\n 1388 | \t\t\t\t\t/* Length of the standard_types array */\n 1389 | int match_counts[sizeof(standard_types) / sizeof(standard_types[0])] = {0};\n 1390 | \t\t\t\t\t/* Number of matches for each standard type */\n 1391 | \n 1392 | if ((pc->types = calloc((size_t)media_type->num_choices, sizeof(pwg_map_t))) == NULL)\n 1393 | {\n 1394 | DEBUG_printf(\"_ppdCacheCreateWithPPD: Unable to allocate %d pwg_map_t's for MediaType.\", media_type->num_choices);\n 1395 | goto create_error;\n 1396 | }\n 1397 | \n 1398 | pc->num_types = media_type->num_choices;\n 1399 | \n 1400 | for (i = media_type->num_choices, choice = media_type->choices,\n 1401 | map = pc->types;\n 1402 | \t i > 0;\n 1403 | \t i --, choice ++, map ++)\n 1404 | {\n 1405 | pwg_name = NULL;\n 1406 | \n 1407 | for (j = 0; j < num_standard_types; j ++)\n 1408 | {\n 1409 | if (standard_types[j].match_length <= 0)\n 1410 | {\n 1411 | if (!_cups_strcasecmp(choice->choice, standard_types[j].ppd_name))\n 1412 | {\n 1413 | pwg_name = standard_types[j].pwg_name;\n 1414 | match_counts[j] ++;\n 1415 | }\n 1416 | }\n 1417 | else if (!_cups_strncasecmp(choice->choice, standard_types[j].ppd_name, (size_t)standard_types[j].match_length))\n 1418 | {\n 1419 | pwg_name = standard_types[j].pwg_name;\n 1420 | match_counts[j] ++;\n 1421 | }\n 1422 | }\n 1423 | \n 1424 | if (!pwg_name)\n 1425 | {\n 1426 | /*\n 1427 | * Convert PPD name to lowercase...\n 1428 | \t*/\n 1429 | \n 1430 | pwg_name = pwg_keyword;\n 1431 | \tpwg_unppdize_name(choice->choice, pwg_keyword, sizeof(pwg_keyword),\n 1432 | \t \"_\");\n 1433 | }\n 1434 | \n 1435 | map->pwg = strdup(pwg_name);\n 1436 | map->ppd = strdup(choice->choice);\n 1437 | }\n 1438 | \n 1439 | /*\n 1440 | * Since three PPD name patterns can map to \"auto\", their match counts\n 1441 | * should each be the count of all three combined.\n 1442 | */\n 1443 | \n 1444 | i = match_counts[0] + match_counts[1] + match_counts[2];\n 1445 | match_counts[0] = match_counts[1] = match_counts[2] = i;\n 1446 | \n 1447 | for (i = 0, choice = media_type->choices, map = pc->types;\n 1448 | i < media_type->num_choices;\n 1449 | i ++, choice ++, map ++)\n 1450 | {\n 1451 | /*\n 1452 | * If there are two matches for any standard PWG media type, don't give\n 1453 | * the PWG name to either one.\n 1454 | */\n 1455 | \n 1456 | for (j = 0; j < num_standard_types; j ++)\n 1457 | {\n 1458 | if (match_counts[j] > 1 && !strcmp(map->pwg, standard_types[j].pwg_name))\n 1459 | {\n 1460 | free(map->pwg);\n 1461 | pwg_unppdize_name(choice->choice, pwg_keyword, sizeof(pwg_keyword), \"_\");\n 1462 | map->pwg = strdup(pwg_keyword);\n 1463 | }\n 1464 | }\n 1465 | \n 1466 | /*\n 1467 | * Add localized text for PWG keyword to message catalog...\n 1468 | */\n 1469 | \n 1470 | snprintf(msg_id, sizeof(msg_id), \"media-type.%s\", map->pwg);\n 1471 | ppd_get_strings(ppd, langs, \"MediaType\", choice, msg_id);\n 1472 | }\n 1473 | }\n 1474 | \n 1475 | /*\n 1476 | * Copy and convert OutputBin data...\n 1477 | */\n 1478 | \n 1479 | if ((output_bin = ppdFindOption(ppd, \"OutputBin\")) != NULL)\n 1480 | {\n 1481 | if ((pc->bins = calloc((size_t)output_bin->num_choices, sizeof(pwg_map_t))) == NULL)\n 1482 | {\n> 1483 | DEBUG_printf(\"_ppdCacheCreateWithPPD: Unable to allocate %d pwg_map_t's for OutputBin.\", output_bin->num_choices);\n 1484 | goto create_error;\n 1485 | }\n 1486 | \n 1487 | pc->num_bins = output_bin->num_choices;\n 1488 | \n 1489 | for (i = output_bin->num_choices, choice = output_bin->choices,\n 1490 | map = pc->bins;\n 1491 | \t i > 0;\n 1492 | \t i --, choice ++, map ++)\n 1493 | {\n 1494 | pwg_unppdize_name(choice->choice, pwg_keyword, sizeof(pwg_keyword), \"_\");\n 1495 | \n 1496 | map->pwg = strdup(pwg_keyword);\n 1497 | map->ppd = strdup(choice->choice);\n 1498 | \n 1499 | /*\n 1500 | * Add localized text for PWG keyword to message catalog...\n 1501 | */\n 1502 | \n 1503 | snprintf(msg_id, sizeof(msg_id), \"output-bin.%s\", pwg_keyword);\n 1504 | ppd_get_strings(ppd, langs, \"OutputBin\", choice, msg_id);\n 1505 | }\n 1506 | }\n 1507 | \n 1508 | if ((ppd_attr = ppdFindAttr(ppd, \"APPrinterPreset\", NULL)) != NULL)\n 1509 | {\n 1510 | /*\n 1511 | * Copy and convert APPrinterPreset (output-mode + print-quality) data...\n 1512 | */\n 1513 | \n 1514 | const char\t*quality,\t\t/* com.apple.print.preset.quality value */\n 1515 | \t\t*output_mode,\t\t/* com.apple.print.preset.output-mode value */\n 1516 | \t\t*color_model_val,\t/* ColorModel choice */\n 1517 | \t\t*graphicsType,\t\t/* com.apple.print.preset.graphicsType value */\n 1518 | \t\t*media_front_coating;\t/* com.apple.print.preset.media-front-coating value */\n 1519 | \n 1520 | do\n 1521 | {\n 1522 | #if 0\n 1523 | /*\n 1524 | * Add localized text for PWG keyword to message catalog...\n 1525 | */\n 1526 | \n 1527 | snprintf(msg_id, sizeof(msg_id), \"preset-name.%s\", ppd_attr->spec);\n 1528 | pwg_add_message(pc->strings, msg_id, ppd_attr->text);\n 1529 | #endif // 0\n 1530 | \n 1531 | /*\n 1532 | * Get the options for this preset...\n 1533 | */\n 1534 | \n 1535 | num_options = _ppdParseOptions(ppd_attr->value, 0, &options,\n 1536 | _PPD_PARSE_ALL);\n 1537 | \n 1538 | if ((quality = cupsGetOption(\"com.apple.print.preset.quality\",\n 1539 | num_options, options)) != NULL)\n 1540 | {\n 1541 | /*\n 1542 | * Get the print-quality for this preset...\n 1543 | \t*/\n 1544 | \n 1545 | \tif (!strcmp(quality, \"low\"))\n 1546 | \t pwg_print_quality = _PWG_PRINT_QUALITY_DRAFT;\n 1547 | \telse if (!strcmp(quality, \"high\"))\n 1548 | \t pwg_print_quality = _PWG_PRINT_QUALITY_HIGH;\n 1549 | \telse\n 1550 | \t pwg_print_quality = _PWG_PRINT_QUALITY_NORMAL;\n 1551 | \n 1552 | /*\n 1553 | \t* Ignore graphicsType \"Photo\" presets that are not high quality.\n 1554 | \t*/\n 1555 | \n 1556 | \tgraphicsType = cupsGetOption(\"com.apple.print.preset.graphicsType\",\n 1557 | \t\t\t\t num_options, options);\n 1558 | \n 1559 | \tif (pwg_print_quality != _PWG_PRINT_QUALITY_HIGH && graphicsType &&\n 1560 | \t !strcmp(graphicsType, \"Photo\"))\n 1561 | \t continue;\n 1562 | \n 1563 | /*\n 1564 | \t* Ignore presets for normal and draft quality where the coating\n 1565 | \t* isn't \"none\" or \"autodetect\".\n 1566 | \t*/\n 1567 | \n 1568 | \tmedia_front_coating = cupsGetOption(\n 1569 | \t \"com.apple.print.preset.media-front-coating\",\n 1570 | \t\t\t num_options, options);\n 1571 | \n 1572 | if (pwg_print_quality != _PWG_PRINT_QUALITY_HIGH &&\n 1573 | \t media_front_coating &&\n 1574 | \t strcmp(media_front_coating, \"none\") &&\n 1575 | \t strcmp(media_front_coating, \"autodetect\"))\n 1576 | \t continue;\n 1577 | \n 1578 | /*\n 1579 | * Get the output mode for this preset...\n 1580 | \t*/\n 1581 | \n 1582 | output_mode = cupsGetOption(\"com.apple.print.preset.output-mode\",\n 1583 | \t num_options, options);", "src_commits": "[{\"path\":\"/src/cups\",\"rev\":\"3935a0ac421137a7b2e7fec176527180bcd8a800\",\"url\":\"https://github.com/OpenPrinting/cups\"},{\"path\":\"/src/fuzzing\",\"rev\":\"152052188b5bfadfb5c258ec9dfbc9c6329fd0b6\",\"url\":\"https://github.com/OpenPrinting/fuzzing.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_ppd_gen_1\",\"fuzz_ppd_gen_cache\",\"fuzz_ppd_gen_conflicts\"]", "cnt": 0, "coverage_keys": "[\"/src/cups/cups/ppd-cache.c\"]", "target_text": "Reach line at /src/cups/cups/ppd-cache.c:1483 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-cups:v2026-07-test1@sha256:986901f42872c2d3f3705368e9546e9f792efc957a11541540c4232fb7eaf36d", "runtime_digest": "sha256:986901f42872c2d3f3705368e9546e9f792efc957a11541540c4232fb7eaf36d", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "cups:merged:src/cups/cups/file.c:1366", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "cups", "harness": "merged", "harness_binaries": "[\"fuzz_array\", \"fuzz_cups\", \"fuzz_http_core\", \"fuzz_ipp\", \"fuzz_ipp_gen\", \"fuzz_ppd_gen_1\", \"fuzz_ppd_gen_cache\", \"fuzz_ppd_gen_conflicts\", \"fuzz_raster\"]", "language": "c", "file": "/src/cups/cups/file.c", "line_start": 1366, "line_end": 1366, "line_count": 1, "function": "", "source_snippet": " 1266 | {\n 1267 | // Range check input...\n 1268 | if (!fp || (fp->mode != 'w' && fp->mode != 's'))\n 1269 | return (-1);\n 1270 | \n 1271 | if (fp->mode == 's')\n 1272 | {\n 1273 | // Send character immediately over socket...\n 1274 | char ch;\t\t\t\t// Output character\n 1275 | \n 1276 | \n 1277 | ch = (char)c;\n 1278 | \n 1279 | if (send(fp->fd, &ch, 1, 0) < 1)\n 1280 | return (-1);\n 1281 | }\n 1282 | else\n 1283 | {\n 1284 | // Buffer it up...\n 1285 | if (fp->ptr >= fp->end)\n 1286 | if (cupsFileFlush(fp))\n 1287 | \treturn (-1);\n 1288 | \n 1289 | *(fp->ptr) ++ = (char)c;\n 1290 | }\n 1291 | \n 1292 | fp->pos ++;\n 1293 | \n 1294 | DEBUG_printf(\"4cupsFilePutChar: pos=\" CUPS_LLFMT, CUPS_LLCAST fp->pos);\n 1295 | \n 1296 | return (0);\n 1297 | }\n 1298 | \n 1299 | \n 1300 | //\n 1301 | // 'cupsFilePutConf()' - Write a configuration line.\n 1302 | //\n 1303 | // This function handles any escaping of the value.\n 1304 | //\n 1305 | // @since CUPS 1.4@\n 1306 | //\n 1307 | \n 1308 | ssize_t\t\t\t\t\t// O - Number of bytes written or -1 on error\n 1309 | cupsFilePutConf(cups_file_t *fp,\t// I - CUPS file\n 1310 | const char *directive,\t// I - Directive\n 1311 | \t\tconst char *value)\t// I - Value\n 1312 | {\n 1313 | ssize_t\tbytes,\t\t\t// Number of bytes written\n 1314 | \t\ttemp;\t\t\t// Temporary byte count\n 1315 | \n 1316 | \n 1317 | if (!fp || !directive || !*directive)\n 1318 | return (-1);\n 1319 | \n 1320 | if ((bytes = cupsFilePuts(fp, directive)) < 0)\n 1321 | return (-1);\n 1322 | \n 1323 | if (value && *value)\n 1324 | {\n 1325 | const char\t*start,\t\t\t// Start of current fragment\n 1326 | \t\t*ptr;\t\t\t// Pointer into value\n 1327 | \n 1328 | if (cupsFilePutChar(fp, ' ') < 0)\n 1329 | return (-1);\n 1330 | bytes ++;\n 1331 | \n 1332 | for (start = ptr = value; *ptr; ptr ++)\n 1333 | {\n 1334 | if (strchr(\"#\\\\\\n\\r\", *ptr) != NULL)\n 1335 | {\n 1336 | // Character that needs to be escaped...\n 1337 | if (ptr > start)\n 1338 | {\n 1339 | // Write unescaped portion...\n 1340 | \t if ((temp = cupsFileWrite(fp, start, (size_t)(ptr - start))) < 0)\n 1341 | \t return (-1);\n 1342 | \n 1343 | \t bytes += temp;\n 1344 | }\n 1345 | \n 1346 | start = ptr + 1;\n 1347 | \n 1348 | if (*ptr == '\\\\')\n 1349 | {\n 1350 | // \"\\\" (for escaping)\n 1351 | if (cupsFilePuts(fp, \"\\\\\\\\\") < 0)\n 1352 | return (-1);\n 1353 | }\n 1354 | else if (*ptr == '#')\n 1355 | {\n 1356 | // \"#\" (for comment)\n 1357 | if (cupsFilePuts(fp, \"\\\\#\") < 0)\n 1358 | return (-1);\n 1359 | }\n 1360 | else if (*ptr == '\\n')\n 1361 | {\n 1362 | // LF\n 1363 | if (cupsFilePuts(fp, \"\\\\n\") < 0)\n 1364 | return (-1);\n 1365 | }\n> 1366 | else if (cupsFilePuts(fp, \"\\\\r\") < 0)\n 1367 | {\n 1368 | \t return (-1);\n 1369 | \t}\n 1370 | \n 1371 | \tbytes += 2;\n 1372 | }\n 1373 | }\n 1374 | \n 1375 | if (ptr > start)\n 1376 | {\n 1377 | // Write remaining unescaped portion...\n 1378 | if ((temp = cupsFileWrite(fp, start, (size_t)(ptr - start))) < 0)\n 1379 | \treturn (-1);\n 1380 | \n 1381 | bytes += temp;\n 1382 | }\n 1383 | }\n 1384 | \n 1385 | if (cupsFilePutChar(fp, '\\n') < 0)\n 1386 | return (-1);\n 1387 | else\n 1388 | return (bytes + 1);\n 1389 | }\n 1390 | \n 1391 | \n 1392 | //\n 1393 | // 'cupsFilePuts()' - Write a string.\n 1394 | //\n 1395 | // Like the @code fputs@ function, no newline is appended to the string.\n 1396 | //\n 1397 | // @since CUPS 1.2@\n 1398 | //\n 1399 | \n 1400 | int\t\t\t\t\t// O - Number of bytes written or -1 on error\n 1401 | cupsFilePuts(cups_file_t *fp,\t\t// I - CUPS file\n 1402 | const char *s)\t\t// I - String to write\n 1403 | {\n 1404 | ssize_t\tbytes;\t\t\t// Bytes to write\n 1405 | \n 1406 | \n 1407 | // Range check input...\n 1408 | if (!fp || !s || (fp->mode != 'w' && fp->mode != 's'))\n 1409 | return (-1);\n 1410 | \n 1411 | // Write the string...\n 1412 | bytes = (ssize_t)strlen(s);\n 1413 | \n 1414 | if (fp->mode == 's')\n 1415 | {\n 1416 | if (cups_write(fp, s, (size_t)bytes) < 0)\n 1417 | return (-1);\n 1418 | \n 1419 | fp->pos += bytes;\n 1420 | \n 1421 | DEBUG_printf(\"4cupsFilePuts: pos=\" CUPS_LLFMT, CUPS_LLCAST fp->pos);\n 1422 | \n 1423 | return ((int)bytes);\n 1424 | }\n 1425 | \n 1426 | if ((fp->ptr + bytes) > fp->end)\n 1427 | if (cupsFileFlush(fp))\n 1428 | return (-1);\n 1429 | \n 1430 | fp->pos += bytes;\n 1431 | \n 1432 | DEBUG_printf(\"4cupsFilePuts: pos=\" CUPS_LLFMT, CUPS_LLCAST fp->pos);\n 1433 | \n 1434 | if ((size_t)bytes > sizeof(fp->buf))\n 1435 | {\n 1436 | if (fp->compressed)\n 1437 | return ((int)cups_compress(fp, s, (size_t)bytes));\n 1438 | else\n 1439 | return ((int)cups_write(fp, s, (size_t)bytes));\n 1440 | }\n 1441 | else\n 1442 | {\n 1443 | memcpy(fp->ptr, s, (size_t)bytes);\n 1444 | fp->ptr += bytes;\n 1445 | \n 1446 | if (fp->is_stdio && cupsFileFlush(fp))\n 1447 | return (-1);\n 1448 | else\n 1449 | return ((int)bytes);\n 1450 | }\n 1451 | }\n 1452 | \n 1453 | \n 1454 | //\n 1455 | // 'cupsFileRead()' - Read from a file.\n 1456 | //\n 1457 | // @since CUPS 1.2@\n 1458 | //\n 1459 | \n 1460 | ssize_t\t\t\t\t\t// O - Number of bytes read or -1 on error\n 1461 | cupsFileRead(cups_file_t *fp,\t\t// I - CUPS file\n 1462 | char *buf,\t\t// O - Buffer\n 1463 | \t size_t bytes)\t\t// I - Number of bytes to read\n 1464 | {\n 1465 | size_t\ttotal;\t\t\t// Total bytes read\n 1466 | ssize_t\tcount;\t\t\t// Bytes read", "src_commits": "[{\"path\":\"/src/cups\",\"rev\":\"3935a0ac421137a7b2e7fec176527180bcd8a800\",\"url\":\"https://github.com/OpenPrinting/cups\"},{\"path\":\"/src/fuzzing\",\"rev\":\"152052188b5bfadfb5c258ec9dfbc9c6329fd0b6\",\"url\":\"https://github.com/OpenPrinting/fuzzing.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_ppd_gen_cache\"]", "cnt": 0, "coverage_keys": "[\"/src/cups/cups/file.c\"]", "target_text": "Reach line at /src/cups/cups/file.c:1366 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-cups:v2026-07-test1@sha256:986901f42872c2d3f3705368e9546e9f792efc957a11541540c4232fb7eaf36d", "runtime_digest": "sha256:986901f42872c2d3f3705368e9546e9f792efc957a11541540c4232fb7eaf36d", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "cups:merged:src/cups/cups/array.c:1187", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "cups", "harness": "merged", "harness_binaries": "[\"fuzz_array\", \"fuzz_cups\", \"fuzz_http_core\", \"fuzz_ipp\", \"fuzz_ipp_gen\", \"fuzz_ppd_gen_1\", \"fuzz_ppd_gen_cache\", \"fuzz_ppd_gen_conflicts\", \"fuzz_raster\"]", "language": "c", "file": "/src/cups/cups/array.c", "line_start": 1187, "line_end": 1187, "line_count": 1, "function": "", "source_snippet": " 1087 | \n 1088 | if (a->alloc_elements == 0)\n 1089 | {\n 1090 | count = 16;\n 1091 | temp = malloc((size_t)count * sizeof(void *));\n 1092 | }\n 1093 | else\n 1094 | {\n 1095 | if (a->alloc_elements < 1024)\n 1096 | count = a->alloc_elements * 2;\n 1097 | else\n 1098 | count = a->alloc_elements + 1024;\n 1099 | \n 1100 | temp = realloc(a->elements, (size_t)count * sizeof(void *));\n 1101 | }\n 1102 | \n 1103 | DEBUG_printf(\"9cups_array_add: count=\" CUPS_LLFMT, CUPS_LLCAST count);\n 1104 | \n 1105 | if (!temp)\n 1106 | {\n 1107 | DEBUG_puts(\"9cups_array_add: allocation failed, returning 0\");\n 1108 | return (0);\n 1109 | }\n 1110 | \n 1111 | a->alloc_elements = count;\n 1112 | a->elements = temp;\n 1113 | }\n 1114 | \n 1115 | // Find the insertion point for the new element; if there is no\n 1116 | // compare function or elements, just add it to the beginning or end...\n 1117 | if (!a->num_elements || !a->compare)\n 1118 | {\n 1119 | // No elements or comparison function, insert/append as needed...\n 1120 | if (insert)\n 1121 | current = 0;\t\t\t// Insert at beginning\n 1122 | else\n 1123 | current = a->num_elements;\t// Append to the end\n 1124 | }\n 1125 | else\n 1126 | {\n 1127 | // Do a binary search for the insertion point...\n 1128 | current = cups_array_find(a, e, a->insert, &diff);\n 1129 | \n 1130 | if (diff > 0)\n 1131 | {\n 1132 | // Insert after the current element...\n 1133 | current ++;\n 1134 | }\n 1135 | else if (!diff)\n 1136 | {\n 1137 | // Compared equal, make sure we add to the beginning or end of\n 1138 | // the current run of equal elements...\n 1139 | a->unique = 0;\n 1140 | \n 1141 | if (insert)\n 1142 | {\n 1143 | // Insert at beginning of run...\n 1144 | \twhile (current > 0 && !(*(a->compare))(e, a->elements[current - 1], a->data))\n 1145 | current --;\n 1146 | }\n 1147 | else\n 1148 | {\n 1149 | // Append at end of run...\n 1150 | \tdo\n 1151 | \t{\n 1152 | current ++;\n 1153 | \t}\n 1154 | \twhile (current < a->num_elements && !(*(a->compare))(e, a->elements[current], a->data));\n 1155 | }\n 1156 | }\n 1157 | }\n 1158 | \n 1159 | // Insert or append the element...\n 1160 | if (current < a->num_elements)\n 1161 | {\n 1162 | // Shift other elements to the right...\n 1163 | memmove(a->elements + current + 1, a->elements + current, (size_t)(a->num_elements - current) * sizeof(void *));\n 1164 | \n 1165 | if (a->current >= current)\n 1166 | a->current ++;\n 1167 | \n 1168 | for (i = 0; i < a->num_saved; i ++)\n 1169 | {\n 1170 | if (a->saved[i] >= current)\n 1171 | \ta->saved[i] ++;\n 1172 | }\n 1173 | \n 1174 | DEBUG_printf(\"9cups_array_add: insert element at index \" CUPS_LLFMT, CUPS_LLCAST current);\n 1175 | }\n 1176 | #ifdef DEBUG\n 1177 | else\n 1178 | {\n 1179 | DEBUG_printf(\"9cups_array_add: append element at \" CUPS_LLFMT, CUPS_LLCAST current);\n 1180 | }\n 1181 | #endif // DEBUG\n 1182 | \n 1183 | if (a->copyfunc)\n 1184 | {\n 1185 | if ((a->elements[current] = (a->copyfunc)(e, a->data)) == NULL)\n 1186 | {\n> 1187 | DEBUG_puts(\"8cups_array_add: Copy function returned NULL, returning 0\");\n 1188 | return (0);\n 1189 | }\n 1190 | }\n 1191 | else\n 1192 | {\n 1193 | a->elements[current] = e;\n 1194 | }\n 1195 | \n 1196 | a->num_elements ++;\n 1197 | a->insert = current;\n 1198 | \n 1199 | DEBUG_puts(\"9cups_array_add: returning 1\");\n 1200 | \n 1201 | return (1);\n 1202 | }\n 1203 | \n 1204 | \n 1205 | //\n 1206 | // 'cups_array_find()' - Find an element in the array.\n 1207 | //\n 1208 | \n 1209 | static int\t\t\t\t// O - Index of match\n 1210 | cups_array_find(cups_array_t *a,\t// I - Array\n 1211 | \tvoid *e,\t// I - Element\n 1212 | \t\tint prev,\t// I - Previous index\n 1213 | \t\tint *rdiff)\t// O - Difference of match\n 1214 | {\n 1215 | int\tleft,\t\t\t\t// Left side of search\n 1216 | \tright,\t\t\t\t// Right side of search\n 1217 | \tcurrent,\t\t\t// Current element\n 1218 | \tdiff;\t\t\t\t// Comparison with current element\n 1219 | \n 1220 | \n 1221 | DEBUG_printf(\"7cups_array_find(a=%p, e=%p, prev=%d, rdiff=%p)\", (void *)a, e, prev, (void *)rdiff);\n 1222 | \n 1223 | if (a->compare)\n 1224 | {\n 1225 | // Do a binary search for the element...\n 1226 | DEBUG_puts(\"9cups_array_find: binary search\");\n 1227 | \n 1228 | if (prev >= 0 && prev < a->num_elements)\n 1229 | {\n 1230 | // Start search on either side of previous...\n 1231 | if ((diff = (*(a->compare))(e, a->elements[prev], a->data)) == 0 || (diff < 0 && prev == 0) || (diff > 0 && prev == (a->num_elements - 1)))\n 1232 | {\n 1233 | // Exact or edge match, return it!\n 1234 | DEBUG_printf(\"9cups_array_find: Returning %d, diff=%d\", prev, diff);\n 1235 | \n 1236 | \t*rdiff = diff;\n 1237 | \n 1238 | \treturn (prev);\n 1239 | }\n 1240 | else if (diff < 0)\n 1241 | {\n 1242 | // Start with previous on right side...\n 1243 | \tleft = 0;\n 1244 | \tright = prev;\n 1245 | }\n 1246 | else\n 1247 | {\n 1248 | // Start with previous on left side...\n 1249 | left = prev;\n 1250 | \tright = a->num_elements - 1;\n 1251 | }\n 1252 | }\n 1253 | else\n 1254 | {\n 1255 | // Start search in the middle...\n 1256 | left = 0;\n 1257 | right = a->num_elements - 1;\n 1258 | }\n 1259 | \n 1260 | do\n 1261 | {\n 1262 | current = (left + right) / 2;\n 1263 | diff = (*(a->compare))(e, a->elements[current], a->data);\n 1264 | \n 1265 | DEBUG_printf(\"9cups_array_find: left=%d, right=%d, current=%d, diff=%d\", left, right, current, diff);\n 1266 | \n 1267 | if (diff == 0)\n 1268 | \tbreak;\n 1269 | else if (diff < 0)\n 1270 | \tright = current;\n 1271 | else\n 1272 | \tleft = current;\n 1273 | }\n 1274 | while ((right - left) > 1);\n 1275 | \n 1276 | if (diff != 0)\n 1277 | {\n 1278 | // Check the last 1 or 2 elements...\n 1279 | if ((diff = (*(a->compare))(e, a->elements[left], a->data)) <= 0)\n 1280 | {\n 1281 | current = left;\n 1282 | }\n 1283 | else\n 1284 | {\n 1285 | diff = (*(a->compare))(e, a->elements[right], a->data);\n 1286 | current = right;\n 1287 | }", "src_commits": "[{\"path\":\"/src/cups\",\"rev\":\"3935a0ac421137a7b2e7fec176527180bcd8a800\",\"url\":\"https://github.com/OpenPrinting/cups\"},{\"path\":\"/src/fuzzing\",\"rev\":\"152052188b5bfadfb5c258ec9dfbc9c6329fd0b6\",\"url\":\"https://github.com/OpenPrinting/fuzzing.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_array\",\"fuzz_http_core\",\"fuzz_ipp\",\"fuzz_ipp_gen\",\"fuzz_ppd_gen_1\",\"fuzz_ppd_gen_cache\",\"fuzz_ppd_gen_conflicts\"]", "cnt": 0, "coverage_keys": "[\"/src/cups/cups/array.c\"]", "target_text": "Reach line at /src/cups/cups/array.c:1187 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-cups:v2026-07-test1@sha256:986901f42872c2d3f3705368e9546e9f792efc957a11541540c4232fb7eaf36d", "runtime_digest": "sha256:986901f42872c2d3f3705368e9546e9f792efc957a11541540c4232fb7eaf36d", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "cups:merged:src/cups/cups/usersys.c:1415", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "cups", "harness": "merged", "harness_binaries": "[\"fuzz_array\", \"fuzz_cups\", \"fuzz_http_core\", \"fuzz_ipp\", \"fuzz_ipp_gen\", \"fuzz_ppd_gen_1\", \"fuzz_ppd_gen_cache\", \"fuzz_ppd_gen_conflicts\", \"fuzz_raster\"]", "language": "c", "file": "/src/cups/cups/usersys.c", "line_start": 1415, "line_end": 1415, "line_count": 1, "function": "", "source_snippet": " 1315 | {\n 1316 | // Something we don't understand...\n 1317 | DEBUG_printf(\"2_cupsSetDefaults: Unknown FilterType '%s'.\", ptr);\n 1318 | }\n 1319 | }\n 1320 | }\n 1321 | \n 1322 | DEBUG_printf(\"1_cupsSetDefaults: FilterType value 0x%x mask 0x%x\", cg->filter_type, cg->filter_type_mask);\n 1323 | \n 1324 | DEBUG_printf(\"1_cupsSetDefaults: AllowAnyRoot %s\", cg->any_root ? \"Yes\" : \"No\");\n 1325 | DEBUG_printf(\"1_cupsSetDefaults: AllowExpiredCerts %s\", cg->expired_certs ? \"Yes\" : \"No\");\n 1326 | DEBUG_printf(\"1_cupsSetDefaults: DigestOptions %s\", cg->digestoptions == _CUPS_DIGESTOPTIONS_DENYMD5 ? \"DenyMD5\" : \"None\");\n 1327 | DEBUG_printf(\"1_cupsSetDefaults: Encryption %s\", encryptions[cg->encryption]);\n 1328 | DEBUG_printf(\"1_cupsSetDefaults: ServerName %s\", cg->servername);\n 1329 | DEBUG_printf(\"1_cupsSetDefaults: SSLOptions%s%s%s%s Min%s Max%s\", cc.ssl_options == _HTTP_TLS_NONE ? \" none\" : \"\", (cc.ssl_options & _HTTP_TLS_ALLOW_RC4) ? \" AllowRC4\" : \"\", (cc.ssl_options & _HTTP_TLS_ALLOW_DH) ? \" AllowDH\" : \"\", (cc.ssl_options & _HTTP_TLS_DENY_CBC) ? \" DenyCBC\" : \"\", tls_versions[cc.ssl_min_version], tls_versions[cc.ssl_max_version]);\n 1330 | DEBUG_printf(\"1_cupsSetDefaults: TrustOnFirstUse %s\", cg->trust_first ? \"Yes\" : \"No\");\n 1331 | DEBUG_printf(\"1_cupsSetDefaults: User %s\", cg->user);\n 1332 | DEBUG_printf(\"1_cupsSetDefaults: UserAgentTokens %s\", uatokens[cg->uatokens]);\n 1333 | DEBUG_printf(\"1_cupsSetDefaults: ValidateCerts %s\", cg->validate_certs ? \"Yes\" : \"No\");\n 1334 | \n 1335 | _httpTLSSetOptions(cc.ssl_options | _HTTP_TLS_SET_DEFAULT, cc.ssl_min_version, cc.ssl_max_version);\n 1336 | \n 1337 | cg->client_conf_loaded = true;\n 1338 | }\n 1339 | \n 1340 | \n 1341 | #ifdef __APPLE__\n 1342 | //\n 1343 | // 'cups_apple_get_boolean()' - Get a boolean setting from the CUPS preferences.\n 1344 | //\n 1345 | \n 1346 | static int\t\t\t\t// O - 1 if set, 0 otherwise\n 1347 | cups_apple_get_boolean(\n 1348 | CFStringRef key,\t\t\t// I - Key (name)\n 1349 | int *value)\t\t\t// O - Boolean value\n 1350 | {\n 1351 | Boolean\tbval,\t\t\t// Preference value\n 1352 | \t\tbval_set;\t\t// Value is set?\n 1353 | \n 1354 | \n 1355 | bval = CFPreferencesGetAppBooleanValue(key, kCUPSPrintingPrefs, &bval_set);\n 1356 | \n 1357 | if (bval_set)\n 1358 | *value = (int)bval;\n 1359 | \n 1360 | return ((int)bval_set);\n 1361 | }\n 1362 | \n 1363 | \n 1364 | //\n 1365 | // 'cups_apple_get_string()' - Get a string setting from the CUPS preferences.\n 1366 | //\n 1367 | \n 1368 | static int\t\t\t\t// O - 1 if set, 0 otherwise\n 1369 | cups_apple_get_string(\n 1370 | CFStringRef key,\t\t\t// I - Key (name)\n 1371 | char *value,\t\t\t// O - String value\n 1372 | size_t valsize)\t\t// I - Size of value buffer\n 1373 | {\n 1374 | CFStringRef\tsval;\t\t\t// String value\n 1375 | \n 1376 | \n 1377 | if ((sval = CFPreferencesCopyAppValue(key, kCUPSPrintingPrefs)) != NULL)\n 1378 | {\n 1379 | Boolean result = CFStringGetCString(sval, value, (CFIndex)valsize, kCFStringEncodingUTF8);\n 1380 | \n 1381 | CFRelease(sval);\n 1382 | \n 1383 | if (result)\n 1384 | return (1);\n 1385 | }\n 1386 | \n 1387 | return (0);\n 1388 | }\n 1389 | #endif // __APPLE__\n 1390 | \n 1391 | \n 1392 | //\n 1393 | // 'cups_boolean_value()' - Convert a string to a boolean value.\n 1394 | //\n 1395 | \n 1396 | static int\t\t\t\t// O - Boolean value\n 1397 | cups_boolean_value(const char *value)\t// I - String value\n 1398 | {\n 1399 | return (!_cups_strcasecmp(value, \"yes\") || !_cups_strcasecmp(value, \"on\") || !_cups_strcasecmp(value, \"true\"));\n 1400 | }\n 1401 | \n 1402 | \n 1403 | //\n 1404 | // 'cups_finalize_client_conf()' - Finalize client.conf values.\n 1405 | //\n 1406 | \n 1407 | static void\n 1408 | cups_finalize_client_conf(\n 1409 | _cups_client_conf_t *cc)\t\t// I - client.conf values\n 1410 | {\n 1411 | const char\t*value;\t\t\t// Environment variable\n 1412 | \n 1413 | \n 1414 | if ((value = getenv(\"CUPS_BROWSE_DOMAINS\")) != NULL)\n> 1415 | cups_set_browse_domains(cc, value);\n 1416 | \n 1417 | if ((value = getenv(\"CUPS_FILTER_LOCATION\")) != NULL)\n 1418 | cups_set_filter_location(cc, value);\n 1419 | \n 1420 | if ((value = getenv(\"CUPS_FILTER_TYPE\")) != NULL)\n 1421 | cups_set_filter_type(cc, value);\n 1422 | \n 1423 | if ((value = getenv(\"CUPS_TRUSTFIRST\")) != NULL)\n 1424 | cc->trust_first = cups_boolean_value(value);\n 1425 | \n 1426 | if ((value = getenv(\"CUPS_ANYROOT\")) != NULL)\n 1427 | cc->any_root = cups_boolean_value(value);\n 1428 | \n 1429 | if ((value = getenv(\"CUPS_ENCRYPTION\")) != NULL)\n 1430 | cups_set_encryption(cc, value);\n 1431 | \n 1432 | if ((value = getenv(\"CUPS_EXPIREDCERTS\")) != NULL)\n 1433 | cc->expired_certs = cups_boolean_value(value);\n 1434 | \n 1435 | #ifdef HAVE_GSSAPI\n 1436 | if ((value = getenv(\"CUPS_GSSSERVICENAME\")) != NULL)\n 1437 | cups_set_gss_service_name(cc, value);\n 1438 | #endif // HAVE_GSSAPI\n 1439 | \n 1440 | if ((value = getenv(\"CUPS_SERVER\")) != NULL)\n 1441 | cups_set_server_name(cc, value);\n 1442 | \n 1443 | if ((value = getenv(\"CUPS_USER\")) != NULL)\n 1444 | cups_set_user(cc, value);\n 1445 | \n 1446 | if ((value = getenv(\"CUPS_VALIDATECERTS\")) != NULL)\n 1447 | cc->validate_certs = cups_boolean_value(value);\n 1448 | \n 1449 | // Then apply defaults for those values that haven't been set...\n 1450 | if (cc->trust_first < 0)\n 1451 | cc->trust_first = 1;\n 1452 | \n 1453 | if (cc->any_root < 0)\n 1454 | cc->any_root = 1;\n 1455 | \n 1456 | if (cc->encryption == (http_encryption_t)-1)\n 1457 | cc->encryption = HTTP_ENCRYPTION_IF_REQUESTED;\n 1458 | \n 1459 | if (cc->expired_certs < 0)\n 1460 | cc->expired_certs = 0;\n 1461 | \n 1462 | #ifdef HAVE_GSSAPI\n 1463 | if (!cc->gss_service_name[0])\n 1464 | cups_set_gss_service_name(cc, CUPS_DEFAULT_GSSSERVICENAME);\n 1465 | #endif // HAVE_GSSAPI\n 1466 | \n 1467 | if (!cc->server_name[0])\n 1468 | {\n 1469 | // If we are compiled with domain socket support, only use the\n 1470 | // domain socket if it exists and has the right permissions...\n 1471 | #if defined(__APPLE__) && !TARGET_OS_OSX\n 1472 | cups_set_server_name(cc, \"/private/var/run/printd\");\n 1473 | \n 1474 | #else\n 1475 | # ifdef CUPS_DEFAULT_DOMAINSOCKET\n 1476 | if (!access(CUPS_DEFAULT_DOMAINSOCKET, R_OK))\n 1477 | cups_set_server_name(cc, CUPS_DEFAULT_DOMAINSOCKET);\n 1478 | else\n 1479 | # endif // CUPS_DEFAULT_DOMAINSOCKET\n 1480 | cups_set_server_name(cc, \"localhost\");\n 1481 | #endif // __APPLE__ && !TARGET_OS_OSX\n 1482 | }\n 1483 | \n 1484 | if (!cc->user[0])\n 1485 | {\n 1486 | #ifdef _WIN32\n 1487 | // Get the current user name from the OS...\n 1488 | DWORD\tsize;\t\t\t\t// Size of string\n 1489 | \n 1490 | size = sizeof(cc->user);\n 1491 | if (!GetUserNameA(cc->user, &size))\n 1492 | #else\n 1493 | // Try the USER environment variable as the default username...\n 1494 | const char *envuser = getenv(\"USER\");\t// Default username\n 1495 | struct passwd pw;\t\t\t\t// Account information\n 1496 | struct passwd *result = NULL;\t\t// Auxiliary pointer\n 1497 | _cups_globals_t *cg = _cupsGlobals();\t// Pointer to library globals\n 1498 | \n 1499 | if (envuser)\n 1500 | {\n 1501 | // Validate USER matches the current UID, otherwise don't allow it to\n 1502 | // override things... This makes sure that printing after doing su\n 1503 | // or sudo records the correct username.\n 1504 | getpwnam_r(envuser, &pw, cg->pw_buf, PW_BUF_SIZE, &result);\n 1505 | if (result && pw.pw_uid != getuid())\n 1506 | result = NULL;\n 1507 | }\n 1508 | \n 1509 | if (!result)\n 1510 | getpwuid_r(getuid(), &pw, cg->pw_buf, PW_BUF_SIZE, &result);\n 1511 | \n 1512 | if (result)\n 1513 | cupsCopyString(cc->user, pw.pw_name, sizeof(cc->user));\n 1514 | else\n 1515 | #endif // _WIN32", "src_commits": "[{\"path\":\"/src/cups\",\"rev\":\"3935a0ac421137a7b2e7fec176527180bcd8a800\",\"url\":\"https://github.com/OpenPrinting/cups\"},{\"path\":\"/src/fuzzing\",\"rev\":\"152052188b5bfadfb5c258ec9dfbc9c6329fd0b6\",\"url\":\"https://github.com/OpenPrinting/fuzzing.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_ipp\",\"fuzz_ipp_gen\",\"fuzz_ppd_gen_cache\"]", "cnt": 0, "coverage_keys": "[\"/src/cups/cups/usersys.c\"]", "target_text": "Reach line at /src/cups/cups/usersys.c:1415 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-cups:v2026-07-test1@sha256:986901f42872c2d3f3705368e9546e9f792efc957a11541540c4232fb7eaf36d", "runtime_digest": "sha256:986901f42872c2d3f3705368e9546e9f792efc957a11541540c4232fb7eaf36d", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "cups:merged:src/cups/cups/file.c:1436", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "cups", "harness": "merged", "harness_binaries": "[\"fuzz_array\", \"fuzz_cups\", \"fuzz_http_core\", \"fuzz_ipp\", \"fuzz_ipp_gen\", \"fuzz_ppd_gen_1\", \"fuzz_ppd_gen_cache\", \"fuzz_ppd_gen_conflicts\", \"fuzz_raster\"]", "language": "c", "file": "/src/cups/cups/file.c", "line_start": 1436, "line_end": 1436, "line_count": 1, "function": "", "source_snippet": " 1336 | // Character that needs to be escaped...\n 1337 | if (ptr > start)\n 1338 | {\n 1339 | // Write unescaped portion...\n 1340 | \t if ((temp = cupsFileWrite(fp, start, (size_t)(ptr - start))) < 0)\n 1341 | \t return (-1);\n 1342 | \n 1343 | \t bytes += temp;\n 1344 | }\n 1345 | \n 1346 | start = ptr + 1;\n 1347 | \n 1348 | if (*ptr == '\\\\')\n 1349 | {\n 1350 | // \"\\\" (for escaping)\n 1351 | if (cupsFilePuts(fp, \"\\\\\\\\\") < 0)\n 1352 | return (-1);\n 1353 | }\n 1354 | else if (*ptr == '#')\n 1355 | {\n 1356 | // \"#\" (for comment)\n 1357 | if (cupsFilePuts(fp, \"\\\\#\") < 0)\n 1358 | return (-1);\n 1359 | }\n 1360 | else if (*ptr == '\\n')\n 1361 | {\n 1362 | // LF\n 1363 | if (cupsFilePuts(fp, \"\\\\n\") < 0)\n 1364 | return (-1);\n 1365 | }\n 1366 | else if (cupsFilePuts(fp, \"\\\\r\") < 0)\n 1367 | {\n 1368 | \t return (-1);\n 1369 | \t}\n 1370 | \n 1371 | \tbytes += 2;\n 1372 | }\n 1373 | }\n 1374 | \n 1375 | if (ptr > start)\n 1376 | {\n 1377 | // Write remaining unescaped portion...\n 1378 | if ((temp = cupsFileWrite(fp, start, (size_t)(ptr - start))) < 0)\n 1379 | \treturn (-1);\n 1380 | \n 1381 | bytes += temp;\n 1382 | }\n 1383 | }\n 1384 | \n 1385 | if (cupsFilePutChar(fp, '\\n') < 0)\n 1386 | return (-1);\n 1387 | else\n 1388 | return (bytes + 1);\n 1389 | }\n 1390 | \n 1391 | \n 1392 | //\n 1393 | // 'cupsFilePuts()' - Write a string.\n 1394 | //\n 1395 | // Like the @code fputs@ function, no newline is appended to the string.\n 1396 | //\n 1397 | // @since CUPS 1.2@\n 1398 | //\n 1399 | \n 1400 | int\t\t\t\t\t// O - Number of bytes written or -1 on error\n 1401 | cupsFilePuts(cups_file_t *fp,\t\t// I - CUPS file\n 1402 | const char *s)\t\t// I - String to write\n 1403 | {\n 1404 | ssize_t\tbytes;\t\t\t// Bytes to write\n 1405 | \n 1406 | \n 1407 | // Range check input...\n 1408 | if (!fp || !s || (fp->mode != 'w' && fp->mode != 's'))\n 1409 | return (-1);\n 1410 | \n 1411 | // Write the string...\n 1412 | bytes = (ssize_t)strlen(s);\n 1413 | \n 1414 | if (fp->mode == 's')\n 1415 | {\n 1416 | if (cups_write(fp, s, (size_t)bytes) < 0)\n 1417 | return (-1);\n 1418 | \n 1419 | fp->pos += bytes;\n 1420 | \n 1421 | DEBUG_printf(\"4cupsFilePuts: pos=\" CUPS_LLFMT, CUPS_LLCAST fp->pos);\n 1422 | \n 1423 | return ((int)bytes);\n 1424 | }\n 1425 | \n 1426 | if ((fp->ptr + bytes) > fp->end)\n 1427 | if (cupsFileFlush(fp))\n 1428 | return (-1);\n 1429 | \n 1430 | fp->pos += bytes;\n 1431 | \n 1432 | DEBUG_printf(\"4cupsFilePuts: pos=\" CUPS_LLFMT, CUPS_LLCAST fp->pos);\n 1433 | \n 1434 | if ((size_t)bytes > sizeof(fp->buf))\n 1435 | {\n> 1436 | if (fp->compressed)\n 1437 | return ((int)cups_compress(fp, s, (size_t)bytes));\n 1438 | else\n 1439 | return ((int)cups_write(fp, s, (size_t)bytes));\n 1440 | }\n 1441 | else\n 1442 | {\n 1443 | memcpy(fp->ptr, s, (size_t)bytes);\n 1444 | fp->ptr += bytes;\n 1445 | \n 1446 | if (fp->is_stdio && cupsFileFlush(fp))\n 1447 | return (-1);\n 1448 | else\n 1449 | return ((int)bytes);\n 1450 | }\n 1451 | }\n 1452 | \n 1453 | \n 1454 | //\n 1455 | // 'cupsFileRead()' - Read from a file.\n 1456 | //\n 1457 | // @since CUPS 1.2@\n 1458 | //\n 1459 | \n 1460 | ssize_t\t\t\t\t\t// O - Number of bytes read or -1 on error\n 1461 | cupsFileRead(cups_file_t *fp,\t\t// I - CUPS file\n 1462 | char *buf,\t\t// O - Buffer\n 1463 | \t size_t bytes)\t\t// I - Number of bytes to read\n 1464 | {\n 1465 | size_t\ttotal;\t\t\t// Total bytes read\n 1466 | ssize_t\tcount;\t\t\t// Bytes read\n 1467 | \n 1468 | \n 1469 | DEBUG_printf(\"2cupsFileRead(fp=%p, buf=%p, bytes=\" CUPS_LLFMT \")\", (void *)fp, (void *)buf, CUPS_LLCAST bytes);\n 1470 | \n 1471 | // Range check input...\n 1472 | if (!fp || !buf || (fp->mode != 'r' && fp->mode != 's'))\n 1473 | return (-1);\n 1474 | \n 1475 | if (bytes == 0)\n 1476 | return (0);\n 1477 | \n 1478 | if (fp->eof)\n 1479 | {\n 1480 | DEBUG_puts(\"5cupsFileRead: End-of-file!\");\n 1481 | return (-1);\n 1482 | }\n 1483 | \n 1484 | // Loop until all bytes are read...\n 1485 | total = 0;\n 1486 | while (bytes > 0)\n 1487 | {\n 1488 | if (fp->ptr >= fp->end)\n 1489 | if (cups_fill(fp) <= 0)\n 1490 | {\n 1491 | DEBUG_printf(\"4cupsFileRead: cups_fill() returned -1, total=\" CUPS_LLFMT, CUPS_LLCAST total);\n 1492 | \n 1493 | if (total > 0)\n 1494 | return ((ssize_t)total);\n 1495 | \telse\n 1496 | \t return (-1);\n 1497 | }\n 1498 | \n 1499 | count = (ssize_t)(fp->end - fp->ptr);\n 1500 | if (count > (ssize_t)bytes)\n 1501 | count = (ssize_t)bytes;\n 1502 | \n 1503 | memcpy(buf, fp->ptr,(size_t) count);\n 1504 | fp->ptr += count;\n 1505 | fp->pos += count;\n 1506 | \n 1507 | DEBUG_printf(\"4cupsFileRead: pos=\" CUPS_LLFMT, CUPS_LLCAST fp->pos);\n 1508 | \n 1509 | // Update the counts for the last read...\n 1510 | bytes -= (size_t)count;\n 1511 | total += (size_t)count;\n 1512 | buf += count;\n 1513 | }\n 1514 | \n 1515 | // Return the total number of bytes read...\n 1516 | DEBUG_printf(\"3cupsFileRead: total=\" CUPS_LLFMT, CUPS_LLCAST total);\n 1517 | \n 1518 | return ((ssize_t)total);\n 1519 | }\n 1520 | \n 1521 | \n 1522 | //\n 1523 | // 'cupsFileRewind()' - Set the current file position to the beginning of the\n 1524 | // file.\n 1525 | //\n 1526 | // @since CUPS 1.2@\n 1527 | //\n 1528 | \n 1529 | off_t\t\t\t\t\t// O - New file position or -1 on error\n 1530 | cupsFileRewind(cups_file_t *fp)\t\t// I - CUPS file\n 1531 | {\n 1532 | // Range check input...\n 1533 | DEBUG_printf(\"cupsFileRewind(fp=%p)\", (void *)fp);\n 1534 | \n 1535 | if (!fp || fp->mode != 'r')\n 1536 | return (-1);", "src_commits": "[{\"path\":\"/src/cups\",\"rev\":\"3935a0ac421137a7b2e7fec176527180bcd8a800\",\"url\":\"https://github.com/OpenPrinting/cups\"},{\"path\":\"/src/fuzzing\",\"rev\":\"152052188b5bfadfb5c258ec9dfbc9c6329fd0b6\",\"url\":\"https://github.com/OpenPrinting/fuzzing.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_ppd_gen_cache\"]", "cnt": 0, "coverage_keys": "[\"/src/cups/cups/file.c\"]", "target_text": "Reach line at /src/cups/cups/file.c:1436 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-cups:v2026-07-test1@sha256:986901f42872c2d3f3705368e9546e9f792efc957a11541540c4232fb7eaf36d", "runtime_digest": "sha256:986901f42872c2d3f3705368e9546e9f792efc957a11541540c4232fb7eaf36d", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "cyclonedds:merged:src/cyclonedds/src/ddsrt/src/sync/posix/sync.c:180", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "cyclonedds", "harness": "merged", "harness_binaries": "[\"fuzz_config_init\", \"fuzz_handle_rtps_message\", \"fuzz_handshake\", \"fuzz_sample_deser\", \"fuzz_security_deser\", \"fuzz_type_object\"]", "language": "c", "file": "/src/cyclonedds/src/ddsrt/src/sync/posix/sync.c", "line_start": 180, "line_end": 180, "line_count": 1, "function": "", "source_snippet": " 80 | static void ddsrt_cond_init_impl (pthread_cond_t *cond, enum ddsrt_clockid clockid)\n 81 | {\n 82 | pthread_condattr_t condattr;\n 83 | pthread_condattr_init (&condattr);\n 84 | #ifdef DDSRT_HAVE_CONDATTR_SETCLOCK\n 85 | ddsrt_condattr_setclock (&condattr, clockid);\n 86 | #else\n 87 | (void) clockid;\n 88 | #endif\n 89 | if (pthread_cond_init (cond, &condattr) != 0)\n 90 | abort ();\n 91 | pthread_condattr_destroy (&condattr);\n 92 | }\n 93 | \n 94 | void ddsrt_cond_init (ddsrt_cond_t *cond)\n 95 | {\n 96 | pthread_cond_init (&cond->cond, NULL);\n 97 | }\n 98 | \n 99 | void ddsrt_cond_wctime_init (ddsrt_cond_wctime_t *cond)\n 100 | {\n 101 | ddsrt_cond_init_impl (&cond->cond, DDSRT_CLOCK_WALLCLOCK);\n 102 | }\n 103 | \n 104 | void ddsrt_cond_mtime_init (ddsrt_cond_mtime_t *cond)\n 105 | {\n 106 | ddsrt_cond_init_impl (&cond->cond, DDSRT_CLOCK_MONOTONIC);\n 107 | }\n 108 | \n 109 | void ddsrt_cond_etime_init (ddsrt_cond_etime_t *cond)\n 110 | {\n 111 | ddsrt_cond_init_impl (&cond->cond, DDSRT_CLOCK_ELAPSED);\n 112 | }\n 113 | \n 114 | void ddsrt_cond_destroy (ddsrt_cond_t *cond)\n 115 | {\n 116 | if (pthread_cond_destroy (&cond->cond) != 0)\n 117 | abort ();\n 118 | }\n 119 | \n 120 | void ddsrt_cond_wctime_destroy (ddsrt_cond_wctime_t *cond)\n 121 | {\n 122 | if (pthread_cond_destroy (&cond->cond) != 0)\n 123 | abort ();\n 124 | }\n 125 | \n 126 | void ddsrt_cond_mtime_destroy (ddsrt_cond_mtime_t *cond)\n 127 | {\n 128 | if (pthread_cond_destroy (&cond->cond) != 0)\n 129 | abort ();\n 130 | }\n 131 | \n 132 | void ddsrt_cond_etime_destroy (ddsrt_cond_etime_t *cond)\n 133 | {\n 134 | if (pthread_cond_destroy (&cond->cond) != 0)\n 135 | abort ();\n 136 | }\n 137 | \n 138 | void ddsrt_cond_wait (ddsrt_cond_t *cond, ddsrt_mutex_t *mutex)\n 139 | {\n 140 | if (pthread_cond_wait (&cond->cond, &mutex->mutex) != 0)\n 141 | abort ();\n 142 | }\n 143 | \n 144 | void ddsrt_cond_wctime_wait (ddsrt_cond_wctime_t *cond, ddsrt_mutex_t *mutex)\n 145 | {\n 146 | if (pthread_cond_wait (&cond->cond, &mutex->mutex) != 0)\n 147 | abort ();\n 148 | }\n 149 | \n 150 | void ddsrt_cond_mtime_wait (ddsrt_cond_mtime_t *cond, ddsrt_mutex_t *mutex)\n 151 | {\n 152 | if (pthread_cond_wait (&cond->cond, &mutex->mutex) != 0)\n 153 | abort ();\n 154 | }\n 155 | \n 156 | void ddsrt_cond_etime_wait (ddsrt_cond_etime_t *cond, ddsrt_mutex_t *mutex)\n 157 | {\n 158 | if (pthread_cond_wait (&cond->cond, &mutex->mutex) != 0)\n 159 | abort ();\n 160 | }\n 161 | \n 162 | static bool ddsrt_cond_waituntil_impl (pthread_cond_t *cond, pthread_mutex_t *mutex, int64_t abstime)\n 163 | {\n 164 | struct timespec ts = { .tv_sec = 0, .tv_nsec = 0 };\n 165 | if (abstime == DDS_NEVER) {\n 166 | if (pthread_cond_wait(cond, mutex) != 0)\n 167 | abort();\n 168 | return true;\n 169 | }\n 170 | if (abstime > 0) {\n 171 | ts.tv_sec = (time_t) (abstime / DDS_NSECS_IN_SEC);\n 172 | ts.tv_nsec = (suseconds_t) (abstime % DDS_NSECS_IN_SEC);\n 173 | }\n 174 | switch (pthread_cond_timedwait (cond, mutex, &ts)) {\n 175 | case 0:\n 176 | return true;\n 177 | case ETIMEDOUT:\n 178 | return false;\n 179 | default:\n> 180 | break;\n 181 | }\n 182 | abort();\n 183 | return false;\n 184 | }\n 185 | \n 186 | bool ddsrt_cond_wctime_waituntil (ddsrt_cond_wctime_t *cond, ddsrt_mutex_t *mutex, ddsrt_wctime_t abstime)\n 187 | {\n 188 | return ddsrt_cond_waituntil_impl(&cond->cond, &mutex->mutex, abstime.v);\n 189 | }\n 190 | \n 191 | #ifdef DDSRT_HAVE_CONDATTR_SETCLOCK\n 192 | bool ddsrt_cond_mtime_waituntil (ddsrt_cond_mtime_t *cond, ddsrt_mutex_t *mutex, ddsrt_mtime_t abstime)\n 193 | {\n 194 | return ddsrt_cond_waituntil_impl(&cond->cond, &mutex->mutex, abstime.v);\n 195 | }\n 196 | \n 197 | bool ddsrt_cond_etime_waituntil (ddsrt_cond_etime_t *cond, ddsrt_mutex_t *mutex, ddsrt_etime_t abstime)\n 198 | {\n 199 | return ddsrt_cond_waituntil_impl(&cond->cond, &mutex->mutex, abstime.v);\n 200 | }\n 201 | #else\n 202 | static bool ddsrt_cond_waituntil_clockconv_impl (pthread_cond_t *cond, pthread_mutex_t *mutex, int64_t abstime, int64_t tnow_wc, int64_t tnow_src)\n 203 | {\n 204 | if (abstime == DDS_NEVER)\n 205 | return ddsrt_cond_waituntil_impl (cond, mutex, abstime);\n 206 | else if (abstime < tnow_src)\n 207 | return false;\n 208 | else\n 209 | return ddsrt_cond_waituntil_impl (cond, mutex, ddsrt_time_add_duration (tnow_wc, abstime - tnow_src));\n 210 | }\n 211 | \n 212 | bool ddsrt_cond_mtime_waituntil (ddsrt_cond_mtime_t *cond, ddsrt_mutex_t *mutex, ddsrt_mtime_t abstime)\n 213 | {\n 214 | const ddsrt_mtime_t tnow_m = ddsrt_time_monotonic ();\n 215 | const ddsrt_wctime_t tnow_wc = ddsrt_time_wallclock ();\n 216 | return ddsrt_cond_waituntil_clockconv_impl (&cond->cond, &mutex->mutex, abstime.v, tnow_wc.v, tnow_m.v);\n 217 | }\n 218 | \n 219 | bool ddsrt_cond_etime_waituntil (ddsrt_cond_etime_t *cond, ddsrt_mutex_t *mutex, ddsrt_etime_t abstime)\n 220 | {\n 221 | const ddsrt_etime_t tnow_e = ddsrt_time_elapsed ();\n 222 | const ddsrt_wctime_t tnow_wc = ddsrt_time_wallclock ();\n 223 | return ddsrt_cond_waituntil_clockconv_impl (&cond->cond, &mutex->mutex, abstime.v, tnow_wc.v, tnow_e.v);\n 224 | }\n 225 | #endif\n 226 | \n 227 | void ddsrt_cond_signal (ddsrt_cond_t *cond)\n 228 | {\n 229 | if (pthread_cond_signal (&cond->cond) != 0)\n 230 | abort ();\n 231 | }\n 232 | \n 233 | void ddsrt_cond_wctime_signal (ddsrt_cond_wctime_t *cond)\n 234 | {\n 235 | if (pthread_cond_signal (&cond->cond) != 0)\n 236 | abort ();\n 237 | }\n 238 | \n 239 | void ddsrt_cond_mtime_signal (ddsrt_cond_mtime_t *cond)\n 240 | {\n 241 | if (pthread_cond_signal (&cond->cond) != 0)\n 242 | abort ();\n 243 | }\n 244 | \n 245 | void ddsrt_cond_etime_signal (ddsrt_cond_etime_t *cond)\n 246 | {\n 247 | if (pthread_cond_signal (&cond->cond) != 0)\n 248 | abort ();\n 249 | }\n 250 | \n 251 | void ddsrt_cond_broadcast (ddsrt_cond_t *cond)\n 252 | {\n 253 | if (pthread_cond_broadcast (&cond->cond) != 0)\n 254 | abort ();\n 255 | }\n 256 | \n 257 | void ddsrt_cond_wctime_broadcast (ddsrt_cond_wctime_t *cond)\n 258 | {\n 259 | if (pthread_cond_broadcast (&cond->cond) != 0)\n 260 | abort ();\n 261 | }\n 262 | \n 263 | void ddsrt_cond_mtime_broadcast (ddsrt_cond_mtime_t *cond)\n 264 | {\n 265 | if (pthread_cond_broadcast (&cond->cond) != 0)\n 266 | abort ();\n 267 | }\n 268 | \n 269 | void ddsrt_cond_etime_broadcast (ddsrt_cond_etime_t *cond)\n 270 | {\n 271 | if (pthread_cond_broadcast (&cond->cond) != 0)\n 272 | abort ();\n 273 | }\n 274 | \n 275 | void ddsrt_rwlock_init (ddsrt_rwlock_t *rwlock)\n 276 | {\n 277 | #if __SunOS_5_6\n 278 | if (pthread_mutex_init (&rwlock->rwlock, NULL) != 0)\n 279 | abort ();\n 280 | #else", "src_commits": "[{\"path\":\"/src/cyclonedds\",\"rev\":\"3029b992768886f555dab44c6a33f40ab09cb225\",\"url\":\"https://github.com/eclipse-cyclonedds/cyclonedds\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_config_init\",\"fuzz_handle_rtps_message\",\"fuzz_handshake\",\"fuzz_sample_deser\",\"fuzz_type_object\"]", "cnt": 0, "coverage_keys": "[\"/src/cyclonedds/src/ddsrt/src/sync/posix/sync.c\"]", "target_text": "Reach line at /src/cyclonedds/src/ddsrt/src/sync/posix/sync.c:180 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-cyclonedds:v2026-07-test1@sha256:ebce3ee4f0439dc4137e4102d12d1b0958882af2e519a441e1203be06da72dfd", "runtime_digest": "sha256:ebce3ee4f0439dc4137e4102d12d1b0958882af2e519a441e1203be06da72dfd", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "cyclonedds:merged:src/cyclonedds/src/core/cdr/src/dds_cdrstream.c:3384", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "cyclonedds", "harness": "merged", "harness_binaries": "[\"fuzz_config_init\", \"fuzz_handle_rtps_message\", \"fuzz_handshake\", \"fuzz_sample_deser\", \"fuzz_security_deser\", \"fuzz_type_object\"]", "language": "c", "file": "/src/cyclonedds/src/core/cdr/src/dds_cdrstream.c", "line_start": 3384, "line_end": 3384, "line_count": 1, "function": "", "source_snippet": " 3284 | ddsrt_nonnull_all\n 3285 | static const uint32_t *dds_stream_skip_default (char * restrict data, const struct dds_cdrstream_allocator *allocator, const uint32_t *ops, enum sample_data_state sample_state)\n 3286 | {\n 3287 | uint32_t insn;\n 3288 | while ((insn = *ops) != DDS_OP_RTS)\n 3289 | {\n 3290 | switch (DDS_OP (insn))\n 3291 | {\n 3292 | case DDS_OP_ADR: {\n 3293 | ops = dds_stream_skip_adr_default (insn, data, allocator, ops, sample_state);\n 3294 | break;\n 3295 | }\n 3296 | case DDS_OP_JSR: {\n 3297 | (void) dds_stream_skip_default (data, allocator, ops + DDS_OP_JUMP (insn), sample_state);\n 3298 | ops++;\n 3299 | break;\n 3300 | }\n 3301 | case DDS_OP_RTS: case DDS_OP_JEQ: case DDS_OP_JEQ4: case DDS_OP_KOF: case DDS_OP_PLM: case DDS_OP_MID:\n 3302 | abort ();\n 3303 | break;\n 3304 | case DDS_OP_DLC:\n 3305 | ops = dds_stream_skip_delimited_default (data, allocator, ops, sample_state);\n 3306 | break;\n 3307 | case DDS_OP_PLC:\n 3308 | ops = dds_stream_skip_pl_default (data, allocator, ops, sample_state);\n 3309 | break;\n 3310 | }\n 3311 | }\n 3312 | return ops;\n 3313 | }\n 3314 | \n 3315 | ddsrt_attribute_warn_unused_result ddsrt_nonnull_all\n 3316 | static const uint32_t *dds_stream_read_delimited (dds_istream_t *is, char * restrict data, const struct dds_cdrstream_allocator *allocator, const uint32_t *ops, enum cdr_data_kind cdr_kind, enum sample_data_state sample_state)\n 3317 | {\n 3318 | uint32_t delimited_offs = is->m_index, insn, delimited_sz = is->m_size - is->m_index;\n 3319 | ops++; // skip DLC op\n 3320 | while ((insn = *ops) != DDS_OP_RTS)\n 3321 | {\n 3322 | switch (DDS_OP (insn))\n 3323 | {\n 3324 | case DDS_OP_ADR: {\n 3325 | /* skip fields that are not in serialized data for appendable type */\n 3326 | ops = (is->m_index - delimited_offs < delimited_sz) ? dds_stream_read_adr (insn, is, data, allocator, ops, false, cdr_kind, sample_state) : dds_stream_skip_adr_default (insn, data, allocator, ops, sample_state);\n 3327 | break;\n 3328 | }\n 3329 | case DDS_OP_JSR: {\n 3330 | (void) dds_stream_read_impl (is, data, allocator, ops + DDS_OP_JUMP (insn), false, cdr_kind, sample_state);\n 3331 | ops++;\n 3332 | break;\n 3333 | }\n 3334 | case DDS_OP_RTS: case DDS_OP_JEQ: case DDS_OP_JEQ4: case DDS_OP_KOF: case DDS_OP_DLC: case DDS_OP_PLC: case DDS_OP_PLM: case DDS_OP_MID: {\n 3335 | abort ();\n 3336 | break;\n 3337 | }\n 3338 | }\n 3339 | }\n 3340 | /* Skip remainder of serialized data for this appendable type */\n 3341 | if (delimited_sz > is->m_index - delimited_offs)\n 3342 | is->m_index += delimited_sz - (is->m_index - delimited_offs);\n 3343 | return ops;\n 3344 | }\n 3345 | \n 3346 | ddsrt_nonnull_all\n 3347 | static bool dds_stream_read_pl_member (dds_istream_t *is, char * restrict data, const struct dds_cdrstream_allocator *allocator, uint32_t m_id, const uint32_t *ops, enum cdr_data_kind cdr_kind, enum sample_data_state sample_state)\n 3348 | {\n 3349 | uint32_t insn, ops_csr = 0;\n 3350 | bool found = false;\n 3351 | \n 3352 | /* FIXME: continue finding the member in the ops member list starting from the last\n 3353 | found one, because in many cases the members will be in the data sequentially */\n 3354 | while (!found && (insn = ops[ops_csr]) != DDS_OP_RTS)\n 3355 | {\n 3356 | assert (DDS_OP (insn) == DDS_OP_PLM);\n 3357 | uint32_t flags = DDS_PLM_FLAGS (insn);\n 3358 | const uint32_t *plm_ops = ops + ops_csr + DDS_OP_ADR_PLM (insn);\n 3359 | if (flags & DDS_OP_FLAG_BASE)\n 3360 | {\n 3361 | assert (DDS_OP (plm_ops[0]) == DDS_OP_PLC);\n 3362 | plm_ops++; /* skip PLC to go to first PLM from base type */\n 3363 | found = dds_stream_read_pl_member (is, data, allocator, m_id, plm_ops, cdr_kind, sample_state);\n 3364 | }\n 3365 | else if (ops[ops_csr + 1] == m_id)\n 3366 | {\n 3367 | (void) dds_stream_read_impl (is, data, allocator, plm_ops, true, cdr_kind, sample_state);\n 3368 | found = true;\n 3369 | break;\n 3370 | }\n 3371 | ops_csr += 2;\n 3372 | }\n 3373 | return found;\n 3374 | }\n 3375 | \n 3376 | ddsrt_attribute_warn_unused_result ddsrt_nonnull_all\n 3377 | static const uint32_t *dds_stream_read_xcdr1_pl (dds_istream_t *is, char * restrict data, const struct dds_cdrstream_allocator *allocator, const uint32_t *ops, enum cdr_data_kind cdr_kind, enum sample_data_state sample_state)\n 3378 | {\n 3379 | /* skip PLC op */\n 3380 | ops++;\n 3381 | \n 3382 | /* default-initialize all members\n 3383 | FIXME: optimize so that only members not in received data are initialized */\n> 3384 | dds_stream_skip_pl_memberlist_default (data, allocator, ops, sample_state);\n 3385 | \n 3386 | uint32_t param_mid, param_len;\n 3387 | while (stream_read_xcdr1_paramheader (is, ¶m_mid, ¶m_len))\n 3388 | {\n 3389 | // Move buffer in temporary istream `is1` to start of parameter value and\n 3390 | // set size to param length, so that alignment is reset to 0\n 3391 | dds_istream_t is1 = *is;\n 3392 | is1.m_buffer += is1.m_index;\n 3393 | is1.m_index = 0;\n 3394 | is1.m_size = param_len;\n 3395 | \n 3396 | // find member and deserialize\n 3397 | (void) dds_stream_read_pl_member (&is1, data, allocator, param_mid, ops, cdr_kind, sample_state);\n 3398 | \n 3399 | // forward index in CDR by param_len if found, and also in case member not known\n 3400 | is->m_index += param_len;\n 3401 | }\n 3402 | \n 3403 | /* skip all PLM-memberid pairs */\n 3404 | while (ops[0] != DDS_OP_RTS)\n 3405 | ops += 2;\n 3406 | \n 3407 | return ops;\n 3408 | }\n 3409 | \n 3410 | ddsrt_attribute_warn_unused_result ddsrt_nonnull_all\n 3411 | static const uint32_t *dds_stream_read_xcdr2_pl (dds_istream_t *is, char * restrict data, const struct dds_cdrstream_allocator *allocator, const uint32_t *ops, enum cdr_data_kind cdr_kind, enum sample_data_state sample_state)\n 3412 | {\n 3413 | /* skip PLC op */\n 3414 | ops++;\n 3415 | \n 3416 | /* default-initialize all members\n 3417 | FIXME: optimize so that only members not in received data are initialized */\n 3418 | dds_stream_skip_pl_memberlist_default (data, allocator, ops, sample_state);\n 3419 | \n 3420 | /* read DHEADER */\n 3421 | uint32_t pl_sz = dds_is_get4 (is), pl_offs = is->m_index;\n 3422 | while (is->m_index - pl_offs < pl_sz)\n 3423 | {\n 3424 | /* read EMHEADER and next_int */\n 3425 | uint32_t em_hdr = dds_is_get4 (is);\n 3426 | uint32_t lc = EMHEADER_LENGTH_CODE (em_hdr), m_id = EMHEADER_MEMBERID (em_hdr), msz;\n 3427 | switch (lc)\n 3428 | {\n 3429 | case LENGTH_CODE_1B: case LENGTH_CODE_2B: case LENGTH_CODE_4B: case LENGTH_CODE_8B:\n 3430 | msz = 1u << lc;\n 3431 | break;\n 3432 | case LENGTH_CODE_NEXTINT:\n 3433 | /* read NEXTINT */\n 3434 | msz = dds_is_get4 (is);\n 3435 | break;\n 3436 | case LENGTH_CODE_ALSO_NEXTINT: case LENGTH_CODE_ALSO_NEXTINT4: case LENGTH_CODE_ALSO_NEXTINT8:\n 3437 | /* length is part of serialized data */\n 3438 | msz = dds_is_peek4 (is);\n 3439 | if (lc > LENGTH_CODE_ALSO_NEXTINT)\n 3440 | msz <<= (lc - 4);\n 3441 | break;\n 3442 | default:\n 3443 | abort ();\n 3444 | break;\n 3445 | }\n 3446 | \n 3447 | #ifndef NDEBUG\n 3448 | /* next field starts here (length embedded in member does not include it's own 4 bytes): */\n 3449 | const uint32_t next_off = is->m_index + msz + ((lc >= LENGTH_CODE_ALSO_NEXTINT) ? 4 : 0);\n 3450 | #endif\n 3451 | /* find member and deserialize */\n 3452 | if (!dds_stream_read_pl_member (is, data, allocator, m_id, ops, cdr_kind, sample_state))\n 3453 | {\n 3454 | is->m_index += msz;\n 3455 | if (lc >= LENGTH_CODE_ALSO_NEXTINT)\n 3456 | is->m_index += 4; /* length embedded in member does not include it's own 4 bytes */\n 3457 | }\n 3458 | assert (next_off == is->m_index);\n 3459 | }\n 3460 | \n 3461 | /* skip all PLM-memberid pairs */\n 3462 | while (ops[0] != DDS_OP_RTS)\n 3463 | ops += 2;\n 3464 | \n 3465 | return ops;\n 3466 | }\n 3467 | \n 3468 | static const uint32_t *dds_stream_read_impl (dds_istream_t *is, char * restrict data, const struct dds_cdrstream_allocator *allocator, const uint32_t *ops, bool is_mutable_member, enum cdr_data_kind cdr_kind, enum sample_data_state sample_state)\n 3469 | {\n 3470 | uint32_t insn;\n 3471 | while ((insn = *ops) != DDS_OP_RTS)\n 3472 | {\n 3473 | switch (DDS_OP (insn))\n 3474 | {\n 3475 | case DDS_OP_ADR:\n 3476 | ops = dds_stream_read_adr (insn, is, data, allocator, ops, is_mutable_member, cdr_kind, sample_state);\n 3477 | break;\n 3478 | case DDS_OP_JSR:\n 3479 | (void) dds_stream_read_impl (is, data, allocator, ops + DDS_OP_JUMP (insn), is_mutable_member, cdr_kind, sample_state);\n 3480 | ops++;\n 3481 | break;\n 3482 | case DDS_OP_RTS: case DDS_OP_JEQ: case DDS_OP_JEQ4: case DDS_OP_KOF: case DDS_OP_PLM: case DDS_OP_MID:\n 3483 | abort ();\n 3484 | break;", "src_commits": "[{\"path\":\"/src/cyclonedds\",\"rev\":\"3029b992768886f555dab44c6a33f40ab09cb225\",\"url\":\"https://github.com/eclipse-cyclonedds/cyclonedds\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_config_init\",\"fuzz_handle_rtps_message\",\"fuzz_handshake\",\"fuzz_sample_deser\",\"fuzz_type_object\"]", "cnt": 0, "coverage_keys": "[\"/src/cyclonedds/src/core/cdr/src/dds_cdrstream.c\"]", "target_text": "Reach line at /src/cyclonedds/src/core/cdr/src/dds_cdrstream.c:3384 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-cyclonedds:v2026-07-test1@sha256:ebce3ee4f0439dc4137e4102d12d1b0958882af2e519a441e1203be06da72dfd", "runtime_digest": "sha256:ebce3ee4f0439dc4137e4102d12d1b0958882af2e519a441e1203be06da72dfd", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "cyclonedds:merged:src/cyclonedds/src/core/ddsi/src/ddsi_typewrap.c:1576", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "cyclonedds", "harness": "merged", "harness_binaries": "[\"fuzz_config_init\", \"fuzz_handle_rtps_message\", \"fuzz_handshake\", \"fuzz_sample_deser\", \"fuzz_security_deser\", \"fuzz_type_object\"]", "language": "c", "file": "/src/cyclonedds/src/core/ddsi/src/ddsi_typewrap.c", "line_start": 1576, "line_end": 1576, "line_count": 1, "function": "", "source_snippet": " 1476 | if (ret == DDS_RETCODE_OK)\n 1477 | {\n 1478 | ddsi_xt_type_fini (gv, xt, false);\n 1479 | ret = ret_validate;\n 1480 | }\n 1481 | GVWARNING (\"type \" PTYPEIDFMT \": ddsi_xt_type_add_typeobj with invalid type object\\n\", PTYPEID (xt->id.x));\n 1482 | }\n 1483 | \n 1484 | return ret;\n 1485 | }\n 1486 | \n 1487 | dds_return_t ddsi_xt_type_init_impl (struct ddsi_domaingv *gv, struct xt_type *xt, const struct DDS_XTypes_TypeIdentifier *ti, const struct DDS_XTypes_TypeObject *to)\n 1488 | {\n 1489 | assert (xt);\n 1490 | assert (ti);\n 1491 | dds_return_t ret = DDS_RETCODE_OK;\n 1492 | \n 1493 | ddsi_typeid_copy_impl (&xt->id.x, ti);\n 1494 | if (ti->_d <= DDS_XTypes_TK_STRING16)\n 1495 | {\n 1496 | if (to != NULL)\n 1497 | return DDS_RETCODE_BAD_PARAMETER;\n 1498 | xt->_d = ti->_d;\n 1499 | }\n 1500 | else\n 1501 | {\n 1502 | switch (ti->_d)\n 1503 | {\n 1504 | case DDS_XTypes_TI_STRING8_SMALL:\n 1505 | xt->_d = DDS_XTypes_TK_STRING8;\n 1506 | xt->_u.str8.bound = (DDS_XTypes_LBound) ti->_u.string_sdefn.bound;\n 1507 | break;\n 1508 | case DDS_XTypes_TI_STRING8_LARGE:\n 1509 | xt->_d = DDS_XTypes_TK_STRING8;\n 1510 | xt->_u.str8.bound = ti->_u.string_ldefn.bound;\n 1511 | break;\n 1512 | case DDS_XTypes_TI_STRING16_SMALL:\n 1513 | xt->_d = DDS_XTypes_TK_STRING16;\n 1514 | xt->_u.str16.bound = (DDS_XTypes_LBound) ti->_u.string_sdefn.bound;\n 1515 | break;\n 1516 | case DDS_XTypes_TI_STRING16_LARGE:\n 1517 | xt->_d = DDS_XTypes_TK_STRING16;\n 1518 | xt->_u.str16.bound = ti->_u.string_ldefn.bound;\n 1519 | break;\n 1520 | case DDS_XTypes_TI_PLAIN_SEQUENCE_SMALL:\n 1521 | xt->_d = DDS_XTypes_TK_SEQUENCE;\n 1522 | if ((ret = ddsi_type_register_dep (gv, &xt->id, &xt->_u.seq.c.element_type, ti->_u.seq_sdefn.element_identifier)) != DDS_RETCODE_OK)\n 1523 | goto err;\n 1524 | xt->_u.seq.bound = (DDS_XTypes_LBound) ti->_u.seq_sdefn.bound;\n 1525 | xt_collection_common_init (&xt->_u.seq.c, &ti->_u.seq_sdefn.header);\n 1526 | break;\n 1527 | case DDS_XTypes_TI_PLAIN_SEQUENCE_LARGE:\n 1528 | xt->_d = DDS_XTypes_TK_SEQUENCE;\n 1529 | if ((ret = ddsi_type_register_dep (gv, &xt->id, &xt->_u.seq.c.element_type, ti->_u.seq_ldefn.element_identifier)) != DDS_RETCODE_OK)\n 1530 | goto err;\n 1531 | xt->_u.seq.bound = ti->_u.seq_ldefn.bound;\n 1532 | xt_collection_common_init (&xt->_u.seq.c, &ti->_u.seq_ldefn.header);\n 1533 | break;\n 1534 | case DDS_XTypes_TI_PLAIN_ARRAY_SMALL:\n 1535 | xt->_d = DDS_XTypes_TK_ARRAY;\n 1536 | if ((ret = ddsi_type_register_dep (gv, &xt->id, &xt->_u.array.c.element_type, ti->_u.array_sdefn.element_identifier)) != DDS_RETCODE_OK)\n 1537 | goto err;\n 1538 | xt_collection_common_init (&xt->_u.array.c, &ti->_u.array_sdefn.header);\n 1539 | xt_sbounds_to_lbounds (&xt->_u.array.bounds, &ti->_u.array_sdefn.array_bound_seq);\n 1540 | break;\n 1541 | case DDS_XTypes_TI_PLAIN_ARRAY_LARGE:\n 1542 | xt->_d = DDS_XTypes_TK_ARRAY;\n 1543 | if ((ret = ddsi_type_register_dep (gv, &xt->id, &xt->_u.array.c.element_type, ti->_u.array_ldefn.element_identifier)) != DDS_RETCODE_OK)\n 1544 | goto err;\n 1545 | xt_collection_common_init (&xt->_u.array.c, &ti->_u.array_ldefn.header);\n 1546 | xt_lbounds_dup (&xt->_u.array.bounds, &ti->_u.array_ldefn.array_bound_seq);\n 1547 | break;\n 1548 | case DDS_XTypes_TI_PLAIN_MAP_SMALL:\n 1549 | xt->_d = DDS_XTypes_TK_MAP;\n 1550 | if ((ret = ddsi_type_register_dep (gv, &xt->id, &xt->_u.map.c.element_type, ti->_u.map_sdefn.element_identifier)) != DDS_RETCODE_OK)\n 1551 | goto err;\n 1552 | xt->_u.map.bound = (DDS_XTypes_LBound) ti->_u.map_sdefn.bound;\n 1553 | xt_collection_common_init (&xt->_u.map.c, &ti->_u.map_sdefn.header);\n 1554 | if ((ret = ddsi_type_register_dep (gv, &xt->id, &xt->_u.map.key_type, ti->_u.map_sdefn.key_identifier)) != DDS_RETCODE_OK)\n 1555 | {\n 1556 | ddsi_type_unref_locked (gv, xt->_u.map.c.element_type);\n 1557 | xt->_u.map.c.element_type = NULL;\n 1558 | goto err;\n 1559 | }\n 1560 | break;\n 1561 | case DDS_XTypes_TI_PLAIN_MAP_LARGE:\n 1562 | xt->_d = DDS_XTypes_TK_MAP;\n 1563 | if ((ret = ddsi_type_register_dep (gv, &xt->id, &xt->_u.map.c.element_type, ti->_u.map_ldefn.element_identifier)) != DDS_RETCODE_OK)\n 1564 | goto err;\n 1565 | xt->_u.map.bound = (DDS_XTypes_LBound) ti->_u.map_ldefn.bound;\n 1566 | xt_collection_common_init (&xt->_u.map.c, &ti->_u.map_ldefn.header);\n 1567 | if ((ret = ddsi_type_register_dep (gv, &xt->id, &xt->_u.map.key_type, ti->_u.map_ldefn.key_identifier)) != DDS_RETCODE_OK)\n 1568 | {\n 1569 | ddsi_type_unref_locked (gv, xt->_u.map.c.element_type);\n 1570 | xt->_u.map.c.element_type = NULL;\n 1571 | goto err;\n 1572 | }\n 1573 | break;\n 1574 | case DDS_XTypes_EK_MINIMAL:\n 1575 | if (to != NULL)\n> 1576 | ret = add_minimal_typeobj (gv, xt, to);\n 1577 | break;\n 1578 | case DDS_XTypes_EK_COMPLETE:\n 1579 | if (to != NULL)\n 1580 | ret = add_complete_typeobj (gv, xt, to);\n 1581 | break;\n 1582 | case DDS_XTypes_TI_STRONGLY_CONNECTED_COMPONENT:\n 1583 | xt->_d = DDS_XTypes_TI_STRONGLY_CONNECTED_COMPONENT;\n 1584 | xt->sc_component_id = ti->_u.sc_component_id;\n 1585 | break;\n 1586 | default:\n 1587 | ddsi_typeid_fini (&xt->id);\n 1588 | ret = DDS_RETCODE_UNSUPPORTED; /* not supported */\n 1589 | break;\n 1590 | }\n 1591 | }\n 1592 | if (ret != DDS_RETCODE_OK || (ret = ddsi_xt_validate (gv, xt)) != DDS_RETCODE_OK)\n 1593 | {\n 1594 | GVWARNING (\"type \" PTYPEIDFMT \": ddsi_xt_type_init_impl with invalid type object\\n\", PTYPEID (xt->id.x));\n 1595 | goto err;\n 1596 | }\n 1597 | if ((xt->kind = ddsi_typeid_kind_impl (ti)) == DDSI_TYPEID_KIND_INVALID)\n 1598 | {\n 1599 | GVWARNING (\"type \" PTYPEIDFMT \": ddsi_xt_type_init_impl with invalid typeid\\n\", PTYPEID (xt->id.x));\n 1600 | ret = DDS_RETCODE_BAD_PARAMETER;\n 1601 | goto err;\n 1602 | }\n 1603 | \n 1604 | err:\n 1605 | return ret;\n 1606 | }\n 1607 | \n 1608 | dds_return_t ddsi_xt_type_init (struct ddsi_domaingv *gv, struct xt_type *xt, const ddsi_typeid_t *ti, const ddsi_typeobj_t *to)\n 1609 | {\n 1610 | return ddsi_xt_type_init_impl (gv, xt, &ti->x, &to->x);\n 1611 | }\n 1612 | \n 1613 | static void DDS_XTypes_AppliedVerbatimAnnotation_copy (struct DDS_XTypes_AppliedVerbatimAnnotation *dst, const struct DDS_XTypes_AppliedVerbatimAnnotation *src)\n 1614 | {\n 1615 | assert (dst);\n 1616 | if (src)\n 1617 | {\n 1618 | ddsrt_strlcpy (dst->placement, src->placement, sizeof (dst->placement));\n 1619 | ddsrt_strlcpy (dst->language, src->language, sizeof (dst->language));\n 1620 | dst->text = ddsrt_strdup (src->text);\n 1621 | }\n 1622 | }\n 1623 | \n 1624 | static void DDS_XTypes_AppliedBuiltinTypeAnnotations_copy (struct DDS_XTypes_AppliedBuiltinTypeAnnotations *dst, const struct DDS_XTypes_AppliedBuiltinTypeAnnotations *src)\n 1625 | {\n 1626 | if (src)\n 1627 | {\n 1628 | dst->verbatim = calloc (1, sizeof (*dst->verbatim));\n 1629 | DDS_XTypes_AppliedVerbatimAnnotation_copy (dst->verbatim, src->verbatim);\n 1630 | }\n 1631 | }\n 1632 | \n 1633 | static void DDS_XTypes_AppliedAnnotationParameter_copy (struct DDS_XTypes_AppliedAnnotationParameter *dst, const struct DDS_XTypes_AppliedAnnotationParameter *src)\n 1634 | {\n 1635 | if (src)\n 1636 | {\n 1637 | memcpy (dst->paramname_hash, src->paramname_hash, sizeof (dst->paramname_hash));\n 1638 | dst->value = src->value;\n 1639 | }\n 1640 | }\n 1641 | \n 1642 | static void DDS_XTypes_AppliedAnnotationParameterSeq_copy (struct DDS_XTypes_AppliedAnnotationParameterSeq **dst, const struct DDS_XTypes_AppliedAnnotationParameterSeq *src)\n 1643 | {\n 1644 | if (src)\n 1645 | {\n 1646 | (*dst) = ddsrt_calloc (1, sizeof (**dst));\n 1647 | (*dst)->_maximum = src->_maximum;\n 1648 | (*dst)->_length = src->_length;\n 1649 | (*dst)->_buffer = ddsrt_calloc (src->_length, sizeof (*(*dst)->_buffer));\n 1650 | for (uint32_t n = 0; n < src->_length; n++)\n 1651 | DDS_XTypes_AppliedAnnotationParameter_copy (&(*dst)->_buffer[n], &src->_buffer[n]);\n 1652 | (*dst)->_release = true;\n 1653 | }\n 1654 | }\n 1655 | \n 1656 | static void DDS_XTypes_AppliedAnnotation_copy (struct DDS_XTypes_AppliedAnnotation *dst, const struct DDS_XTypes_AppliedAnnotation *src)\n 1657 | {\n 1658 | if (src)\n 1659 | {\n 1660 | ddsi_typeid_copy_impl (&dst->annotation_typeid, &src->annotation_typeid);\n 1661 | DDS_XTypes_AppliedAnnotationParameterSeq_copy (&dst->param_seq, src->param_seq);\n 1662 | }\n 1663 | }\n 1664 | \n 1665 | static void DDS_XTypes_AppliedAnnotationSeq_copy (struct DDS_XTypes_AppliedAnnotationSeq *dst, const struct DDS_XTypes_AppliedAnnotationSeq *src)\n 1666 | {\n 1667 | if (src)\n 1668 | {\n 1669 | dst->_maximum = src->_maximum;\n 1670 | dst->_length = src->_length;\n 1671 | dst->_buffer = ddsrt_calloc (src->_length, sizeof (*dst->_buffer));\n 1672 | for (uint32_t n = 0; n < src->_length; n++)\n 1673 | DDS_XTypes_AppliedAnnotation_copy (&dst->_buffer[n], &src->_buffer[n]);\n 1674 | dst->_release = true;\n 1675 | }\n 1676 | }", "src_commits": "[{\"path\":\"/src/cyclonedds\",\"rev\":\"3029b992768886f555dab44c6a33f40ab09cb225\",\"url\":\"https://github.com/eclipse-cyclonedds/cyclonedds\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_config_init\",\"fuzz_handle_rtps_message\",\"fuzz_handshake\",\"fuzz_sample_deser\",\"fuzz_type_object\"]", "cnt": 0, "coverage_keys": "[\"/src/cyclonedds/src/core/ddsi/src/ddsi_typewrap.c\"]", "target_text": "Reach line at /src/cyclonedds/src/core/ddsi/src/ddsi_typewrap.c:1576 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-cyclonedds:v2026-07-test1@sha256:ebce3ee4f0439dc4137e4102d12d1b0958882af2e519a441e1203be06da72dfd", "runtime_digest": "sha256:ebce3ee4f0439dc4137e4102d12d1b0958882af2e519a441e1203be06da72dfd", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "cyclonedds:merged:src/cyclonedds/src/core/ddsi/src/ddsi_serdata_pserop.c:147", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "cyclonedds", "harness": "merged", "harness_binaries": "[\"fuzz_config_init\", \"fuzz_handle_rtps_message\", \"fuzz_handshake\", \"fuzz_sample_deser\", \"fuzz_security_deser\", \"fuzz_type_object\"]", "language": "c", "file": "/src/cyclonedds/src/core/ddsi/src/ddsi_serdata_pserop.c", "line_start": 147, "line_end": 147, "line_count": 1, "function": "", "source_snippet": " 47 | struct ddsi_serdata_pserop *d = (struct ddsi_serdata_pserop *) dcmn;\n 48 | const struct ddsi_sertype_pserop *tp = (const struct ddsi_sertype_pserop *) d->c.type;\n 49 | if (d->c.kind == SDK_DATA)\n 50 | ddsi_plist_fini_generic (d->sample, tp->ops, true);\n 51 | if (d->sample)\n 52 | ddsrt_free (d->sample);\n 53 | ddsrt_free (d);\n 54 | }\n 55 | \n 56 | static struct ddsi_serdata_pserop *serdata_pserop_new (const struct ddsi_sertype_pserop *tp, enum ddsi_serdata_kind kind, size_t size, const void *cdr_header)\n 57 | {\n 58 | /* FIXME: check whether this really is the correct maximum: offsets are relative\n 59 | to the CDR header, but there are also some places that use a serdata as-if it\n 60 | were a stream, and those use offsets (m_index) relative to the start of the\n 61 | serdata */\n 62 | assert (kind != SDK_EMPTY);\n 63 | if (size < 4 || size > UINT32_MAX - offsetof (struct ddsi_serdata_pserop, identifier))\n 64 | return NULL;\n 65 | const uint16_t *hdrsrc = cdr_header;\n 66 | if (hdrsrc[0] != DDSI_RTPS_CDR_LE && hdrsrc[0] != DDSI_RTPS_CDR_BE)\n 67 | return NULL;\n 68 | struct ddsi_serdata_pserop *d = ddsrt_malloc (sizeof (*d) + size);\n 69 | if (d == NULL)\n 70 | return NULL;\n 71 | ddsi_serdata_init (&d->c, &tp->c, kind);\n 72 | d->keyless = (tp->ops_key == NULL);\n 73 | d->pos = 0;\n 74 | d->size = (uint32_t) size;\n 75 | d->identifier = hdrsrc[0];\n 76 | d->options = hdrsrc[1];\n 77 | if (kind == SDK_KEY && d->keyless)\n 78 | d->sample = NULL;\n 79 | else if ((d->sample = ddsrt_malloc ((kind == SDK_DATA) ? tp->memsize : 16)) == NULL)\n 80 | {\n 81 | ddsrt_free (d);\n 82 | return NULL;\n 83 | }\n 84 | return d;\n 85 | }\n 86 | \n 87 | static struct ddsi_serdata *serdata_pserop_fix (const struct ddsi_sertype_pserop *tp, struct ddsi_serdata_pserop *d)\n 88 | {\n 89 | const bool needs_bswap = !DDSI_RTPS_CDR_ENC_IS_NATIVE (d->identifier);\n 90 | const enum ddsi_pserop *ops = (d->c.kind == SDK_DATA) ? tp->ops : tp->ops_key;\n 91 | d->c.hash = tp->c.serdata_basehash;\n 92 | if (ops != NULL)\n 93 | {\n 94 | if (ddsi_plist_deser_generic (d->sample, d->data, d->pos, needs_bswap, (d->c.kind == SDK_DATA) ? tp->ops : tp->ops_key) < 0)\n 95 | {\n 96 | ddsrt_free (d->sample);\n 97 | ddsrt_free (d);\n 98 | return NULL;\n 99 | }\n 100 | if (tp->ops_key)\n 101 | {\n 102 | assert (d->pos >= 16 && tp->memsize >= 16);\n 103 | d->c.hash ^= ddsrt_mh3 (d->sample, 16, 0);\n 104 | }\n 105 | }\n 106 | return &d->c;\n 107 | }\n 108 | \n 109 | static struct ddsi_serdata *serdata_pserop_from_ser (const struct ddsi_sertype *tpcmn, enum ddsi_serdata_kind kind, const struct ddsi_rdata *fragchain, size_t size)\n 110 | ddsrt_nonnull_all;\n 111 | \n 112 | static struct ddsi_serdata *serdata_pserop_from_ser (const struct ddsi_sertype *tpcmn, enum ddsi_serdata_kind kind, const struct ddsi_rdata *fragchain, size_t size)\n 113 | {\n 114 | const struct ddsi_sertype_pserop *tp = (const struct ddsi_sertype_pserop *)tpcmn;\n 115 | struct ddsi_serdata_pserop *d = serdata_pserop_new (tp, kind, size, DDSI_RMSG_PAYLOADOFF (fragchain->rmsg, DDSI_RDATA_PAYLOAD_OFF (fragchain)));\n 116 | if (d == NULL)\n 117 | return NULL;\n 118 | uint32_t off = 4; /* must skip the CDR header */\n 119 | assert (fragchain->min == 0);\n 120 | assert (fragchain->maxp1 >= off); /* CDR header must be in first fragment */\n 121 | for (const struct ddsi_rdata *frag = fragchain; frag != NULL; frag = frag->nextfrag)\n 122 | {\n 123 | assert (frag->min <= off);\n 124 | assert (frag->maxp1 <= size);\n 125 | if (frag->maxp1 > off)\n 126 | {\n 127 | /* only copy if this fragment adds data */\n 128 | const unsigned char *payload = DDSI_RMSG_PAYLOADOFF (frag->rmsg, DDSI_RDATA_PAYLOAD_OFF (frag));\n 129 | uint32_t n = frag->maxp1 - off;\n 130 | memcpy (d->data + d->pos, payload + off - frag->min, n);\n 131 | d->pos += n;\n 132 | off = frag->maxp1;\n 133 | }\n 134 | }\n 135 | return serdata_pserop_fix (tp, d);\n 136 | }\n 137 | \n 138 | static struct ddsi_serdata *serdata_pserop_from_ser_iov (const struct ddsi_sertype *tpcmn, enum ddsi_serdata_kind kind, ddsrt_msg_iovlen_t niov, const ddsrt_iovec_t *iov, size_t size)\n 139 | {\n 140 | assert (niov >= 1);\n 141 | if (iov[0].iov_len < 4)\n 142 | {\n 143 | // First fragment to short contain a full CDR header, we could handle it as long\n 144 | // as size >= 4, but it can't really happen anyway (we use this to convert an\n 145 | // already-vetted sample, so there must be a full header). So check & reject\n 146 | // makes the most sense.\n> 147 | return NULL;\n 148 | }\n 149 | const struct ddsi_sertype_pserop *tp = (const struct ddsi_sertype_pserop *)tpcmn;\n 150 | struct ddsi_serdata_pserop *d = serdata_pserop_new (tp, kind, size, iov[0].iov_base);\n 151 | if (d == NULL)\n 152 | return NULL;\n 153 | memcpy (d->data + d->pos, (const char *) iov[0].iov_base + 4, iov[0].iov_len - 4);\n 154 | d->pos += (uint32_t) iov[0].iov_len - 4;\n 155 | for (ddsrt_msg_iovlen_t i = 1; i < niov; i++)\n 156 | {\n 157 | memcpy (d->data + d->pos, (const char *) iov[i].iov_base, iov[i].iov_len);\n 158 | d->pos += (uint32_t) iov[i].iov_len;\n 159 | }\n 160 | return serdata_pserop_fix (tp, d);\n 161 | }\n 162 | \n 163 | static struct ddsi_serdata *serdata_pserop_from_keyhash (const struct ddsi_sertype *tpcmn, const ddsi_keyhash_t *keyhash)\n 164 | {\n 165 | const struct { uint16_t identifier, options; ddsi_keyhash_t kh; } in = { DDSI_RTPS_CDR_BE, 0, *keyhash };\n 166 | const ddsrt_iovec_t iov = { .iov_base = (void *) &in, .iov_len = sizeof (in) };\n 167 | return serdata_pserop_from_ser_iov (tpcmn, SDK_KEY, 1, &iov, sizeof (in) - 4);\n 168 | }\n 169 | \n 170 | static bool serdata_pserop_to_sample (const struct ddsi_serdata *serdata_common, void *sample, void **bufptr, void *buflim)\n 171 | {\n 172 | const struct ddsi_serdata_pserop *d = (const struct ddsi_serdata_pserop *)serdata_common;\n 173 | const struct ddsi_sertype_pserop *tp = (const struct ddsi_sertype_pserop *) d->c.type;\n 174 | if (bufptr) abort(); else { (void)buflim; } /* FIXME: haven't implemented that bit yet! */\n 175 | if (d->c.kind == SDK_KEY)\n 176 | memcpy (sample, d->sample, 16);\n 177 | else\n 178 | {\n 179 | const bool needs_bswap = !DDSI_RTPS_CDR_ENC_IS_NATIVE (d->identifier);\n 180 | dds_return_t ret = ddsi_plist_deser_generic (sample, d->data, d->pos, needs_bswap, tp->ops);\n 181 | ddsi_plist_unalias_generic (sample, tp->ops);\n 182 | assert (ret >= 0);\n 183 | (void) ret;\n 184 | }\n 185 | return true; /* FIXME: can't conversion to sample fail? */\n 186 | }\n 187 | \n 188 | static void serdata_pserop_to_ser (const struct ddsi_serdata *serdata_common, size_t off, size_t sz, void *buf)\n 189 | {\n 190 | const struct ddsi_serdata_pserop *d = (const struct ddsi_serdata_pserop *)serdata_common;\n 191 | memcpy (buf, (char *) &d->identifier + off, sz);\n 192 | }\n 193 | \n 194 | static struct ddsi_serdata *serdata_pserop_to_ser_ref (const struct ddsi_serdata *serdata_common, size_t off, size_t sz, ddsrt_iovec_t *ref)\n 195 | {\n 196 | const struct ddsi_serdata_pserop *d = (const struct ddsi_serdata_pserop *)serdata_common;\n 197 | ref->iov_base = (char *) &d->identifier + off;\n 198 | ref->iov_len = (ddsrt_iov_len_t) sz;\n 199 | return ddsi_serdata_ref (serdata_common);\n 200 | }\n 201 | \n 202 | static void serdata_pserop_to_ser_unref (struct ddsi_serdata *serdata_common, const ddsrt_iovec_t *ref)\n 203 | {\n 204 | (void) ref;\n 205 | ddsi_serdata_unref (serdata_common);\n 206 | }\n 207 | \n 208 | static struct ddsi_serdata *serdata_pserop_from_sample (const struct ddsi_sertype *tpcmn, enum ddsi_serdata_kind kind, const void *sample)\n 209 | {\n 210 | const struct ddsi_sertype_pserop *tp = (const struct ddsi_sertype_pserop *)tpcmn;\n 211 | const struct { uint16_t identifier, options; } header = { ddsi_sertype_get_native_enc_identifier (DDSI_RTPS_CDR_ENC_VERSION_1, tp->encoding_format), 0 };\n 212 | struct ddsi_serdata_pserop *d;\n 213 | if (kind == SDK_KEY && tp->ops_key == NULL)\n 214 | {\n 215 | if ((d = serdata_pserop_new (tp, kind, 0, &header)) == NULL)\n 216 | return NULL;\n 217 | }\n 218 | else\n 219 | {\n 220 | void *data;\n 221 | size_t size;\n 222 | if (ddsi_plist_ser_generic (&data, &size, sample, (kind == SDK_DATA) ? tp->ops : tp->ops_key) < 0)\n 223 | return NULL;\n 224 | const size_t size4 = (size + 3) & ~(size_t)3;\n 225 | if ((d = serdata_pserop_new (tp, kind, size4, &header)) == NULL)\n 226 | {\n 227 | ddsrt_free (data);\n 228 | return NULL;\n 229 | }\n 230 | assert (tp->ops_key == NULL || (size >= 16 && tp->memsize >= 16));\n 231 | assert (d->data != NULL); // clang static analyzer\n 232 | memcpy (d->data, data, size);\n 233 | memset (d->data + size, 0, size4 - size);\n 234 | d->pos = (uint32_t) size;\n 235 | ddsrt_free (data); // FIXME: shouldn't allocate twice & copy\n 236 | // FIXME: and then this silly thing deserialises it immediately again -- perhaps it should be a bit lazier\n 237 | }\n 238 | return serdata_pserop_fix (tp, d);\n 239 | }\n 240 | \n 241 | static struct ddsi_serdata *serdata_pserop_to_untyped (const struct ddsi_serdata *serdata_common)\n 242 | {\n 243 | const struct ddsi_serdata_pserop *d = (const struct ddsi_serdata_pserop *)serdata_common;\n 244 | const struct ddsi_sertype_pserop *tp = (const struct ddsi_sertype_pserop *)d->c.type;\n 245 | ddsrt_iovec_t iov = { .iov_base = (char *) &d->identifier, .iov_len = (ddsrt_iov_len_t) (4 + d->pos) };\n 246 | struct ddsi_serdata *dcmn_tl = serdata_pserop_from_ser_iov (&tp->c, SDK_KEY, 1, &iov, iov.iov_len);\n 247 | assert (dcmn_tl != NULL);", "src_commits": "[{\"path\":\"/src/cyclonedds\",\"rev\":\"3029b992768886f555dab44c6a33f40ab09cb225\",\"url\":\"https://github.com/eclipse-cyclonedds/cyclonedds\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_config_init\",\"fuzz_handle_rtps_message\",\"fuzz_handshake\",\"fuzz_sample_deser\",\"fuzz_type_object\"]", "cnt": 0, "coverage_keys": "[\"/src/cyclonedds/src/core/ddsi/src/ddsi_serdata_pserop.c\"]", "target_text": "Reach line at /src/cyclonedds/src/core/ddsi/src/ddsi_serdata_pserop.c:147 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-cyclonedds:v2026-07-test1@sha256:ebce3ee4f0439dc4137e4102d12d1b0958882af2e519a441e1203be06da72dfd", "runtime_digest": "sha256:ebce3ee4f0439dc4137e4102d12d1b0958882af2e519a441e1203be06da72dfd", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "cyclonedds:merged:src/cyclonedds/src/core/ddsi/src/ddsi_entity_index.c:390", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "cyclonedds", "harness": "merged", "harness_binaries": "[\"fuzz_config_init\", \"fuzz_handle_rtps_message\", \"fuzz_handshake\", \"fuzz_sample_deser\", \"fuzz_security_deser\", \"fuzz_type_object\"]", "language": "c", "file": "/src/cyclonedds/src/core/ddsi/src/ddsi_entity_index.c", "line_start": 390, "line_end": 390, "line_count": 1, "function": "", "source_snippet": " 290 | return true;\n 291 | }\n 292 | \n 293 | void *ddsi_entidx_lookup_guid_untyped (const struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 294 | {\n 295 | /* FIXME: could (now) require guid to be first in entity_common; entity_common already is first in entity */\n 296 | struct ddsi_entity_common e;\n 297 | e.guid = *guid;\n 298 | assert (ddsi_thread_is_awake ());\n 299 | return ddsrt_chh_lookup (ei->guid_hash, &e);\n 300 | }\n 301 | \n 302 | static void *entidx_lookup_guid_int (const struct ddsi_entity_index *ei, const struct ddsi_guid *guid, enum ddsi_entity_kind kind)\n 303 | {\n 304 | struct ddsi_entity_common *res;\n 305 | if ((res = ddsi_entidx_lookup_guid_untyped (ei, guid)) != NULL && res->kind == kind)\n 306 | return res;\n 307 | else\n 308 | return NULL;\n 309 | }\n 310 | \n 311 | void *ddsi_entidx_lookup_guid (const struct ddsi_entity_index *ei, const struct ddsi_guid *guid, enum ddsi_entity_kind kind)\n 312 | {\n 313 | return entidx_lookup_guid_int (ei, guid, kind);\n 314 | }\n 315 | \n 316 | void ddsi_entidx_insert_participant_guid (struct ddsi_entity_index *ei, struct ddsi_participant *pp)\n 317 | {\n 318 | entity_index_insert (ei, &pp->e);\n 319 | }\n 320 | \n 321 | void ddsi_entidx_insert_proxy_participant_guid (struct ddsi_entity_index *ei, struct ddsi_proxy_participant *proxypp)\n 322 | {\n 323 | entity_index_insert (ei, &proxypp->e);\n 324 | }\n 325 | \n 326 | void ddsi_entidx_insert_writer_guid (struct ddsi_entity_index *ei, struct ddsi_writer *wr)\n 327 | {\n 328 | entity_index_insert (ei, &wr->e);\n 329 | }\n 330 | \n 331 | void ddsi_entidx_insert_reader_guid (struct ddsi_entity_index *ei, struct ddsi_reader *rd)\n 332 | {\n 333 | entity_index_insert (ei, &rd->e);\n 334 | }\n 335 | \n 336 | void ddsi_entidx_insert_proxy_writer_guid (struct ddsi_entity_index *ei, struct ddsi_proxy_writer *pwr)\n 337 | {\n 338 | entity_index_insert (ei, &pwr->e);\n 339 | }\n 340 | \n 341 | void ddsi_entidx_insert_proxy_reader_guid (struct ddsi_entity_index *ei, struct ddsi_proxy_reader *prd)\n 342 | {\n 343 | entity_index_insert (ei, &prd->e);\n 344 | }\n 345 | \n 346 | struct ddsi_participant *ddsi_entidx_tryremove_participant_guid (struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 347 | {\n 348 | struct ddsi_participant *pp = ddsi_entidx_lookup_participant_guid (ei, guid);\n 349 | if (pp == NULL || !entity_index_tryremove (ei, &pp->e))\n 350 | return NULL;\n 351 | return pp;\n 352 | }\n 353 | \n 354 | struct ddsi_proxy_participant *ddsi_entidx_tryremove_proxy_participant_guid (struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 355 | {\n 356 | struct ddsi_proxy_participant *proxypp = ddsi_entidx_lookup_proxy_participant_guid (ei, guid);\n 357 | if (proxypp == NULL || !entity_index_tryremove (ei, &proxypp->e))\n 358 | return NULL;\n 359 | return proxypp;\n 360 | }\n 361 | \n 362 | struct ddsi_writer *ddsi_entidx_tryremove_writer_guid (struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 363 | {\n 364 | struct ddsi_writer *wr = ddsi_entidx_lookup_writer_guid (ei, guid);\n 365 | if (wr == NULL || !entity_index_tryremove (ei, &wr->e))\n 366 | return NULL;\n 367 | return wr;\n 368 | }\n 369 | \n 370 | struct ddsi_reader *ddsi_entidx_tryremove_reader_guid (struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 371 | {\n 372 | struct ddsi_reader *rd = ddsi_entidx_lookup_reader_guid (ei, guid);\n 373 | if (rd == NULL || !entity_index_tryremove (ei, &rd->e))\n 374 | return NULL;\n 375 | return rd;\n 376 | }\n 377 | \n 378 | struct ddsi_proxy_writer *ddsi_entidx_tryremove_proxy_writer_guid (struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 379 | {\n 380 | struct ddsi_proxy_writer *pwr = ddsi_entidx_lookup_proxy_writer_guid (ei, guid);\n 381 | if (pwr == NULL || !entity_index_tryremove (ei, &pwr->e))\n 382 | return NULL;\n 383 | return pwr;\n 384 | }\n 385 | \n 386 | struct ddsi_proxy_reader *ddsi_entidx_tryremove_proxy_reader_guid (struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 387 | {\n 388 | struct ddsi_proxy_reader *prd = ddsi_entidx_lookup_proxy_reader_guid (ei, guid);\n 389 | if (prd == NULL || !entity_index_tryremove (ei, &prd->e))\n> 390 | return NULL;\n 391 | return prd;\n 392 | }\n 393 | \n 394 | struct ddsi_participant *ddsi_entidx_lookup_participant_guid (const struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 395 | {\n 396 | DDSRT_STATIC_ASSERT (offsetof (struct ddsi_participant, e) == 0);\n 397 | assert (guid->entityid.u == DDSI_ENTITYID_PARTICIPANT);\n 398 | return entidx_lookup_guid_int (ei, guid, DDSI_EK_PARTICIPANT);\n 399 | }\n 400 | \n 401 | struct ddsi_proxy_participant *ddsi_entidx_lookup_proxy_participant_guid (const struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 402 | {\n 403 | DDSRT_STATIC_ASSERT (offsetof (struct ddsi_proxy_participant, e) == 0);\n 404 | assert (guid->entityid.u == DDSI_ENTITYID_PARTICIPANT);\n 405 | return entidx_lookup_guid_int (ei, guid, DDSI_EK_PROXY_PARTICIPANT);\n 406 | }\n 407 | \n 408 | struct ddsi_writer *ddsi_entidx_lookup_writer_guid (const struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 409 | {\n 410 | DDSRT_STATIC_ASSERT (offsetof (struct ddsi_writer, e) == 0);\n 411 | assert (ddsi_is_writer_entityid (guid->entityid));\n 412 | return entidx_lookup_guid_int (ei, guid, DDSI_EK_WRITER);\n 413 | }\n 414 | \n 415 | struct ddsi_reader *ddsi_entidx_lookup_reader_guid (const struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 416 | {\n 417 | DDSRT_STATIC_ASSERT (offsetof (struct ddsi_reader, e) == 0);\n 418 | assert (ddsi_is_reader_entityid (guid->entityid));\n 419 | return entidx_lookup_guid_int (ei, guid, DDSI_EK_READER);\n 420 | }\n 421 | \n 422 | struct ddsi_proxy_writer *ddsi_entidx_lookup_proxy_writer_guid (const struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 423 | {\n 424 | DDSRT_STATIC_ASSERT (offsetof (struct ddsi_proxy_writer, e) == 0);\n 425 | assert (ddsi_is_writer_entityid (guid->entityid));\n 426 | return entidx_lookup_guid_int (ei, guid, DDSI_EK_PROXY_WRITER);\n 427 | }\n 428 | \n 429 | struct ddsi_proxy_reader *ddsi_entidx_lookup_proxy_reader_guid (const struct ddsi_entity_index *ei, const struct ddsi_guid *guid)\n 430 | {\n 431 | DDSRT_STATIC_ASSERT (offsetof (struct ddsi_proxy_reader, e) == 0);\n 432 | assert (ddsi_is_reader_entityid (guid->entityid));\n 433 | return entidx_lookup_guid_int (ei, guid, DDSI_EK_PROXY_READER);\n 434 | }\n 435 | \n 436 | /* Enumeration */\n 437 | \n 438 | static void entidx_enum_init_minmax_int (struct ddsi_entity_enum *st, const struct ddsi_entity_index *ei, const struct ddsi_match_entities_range_key *min)\n 439 | {\n 440 | /* Use a lock to protect against concurrent modification and rely on the GC not deleting\n 441 | any entities while enumerating so we can rely on the (kind, topic, GUID) triple to\n 442 | remain valid for looking up the next entity. With a bit of additional effort it would\n 443 | be possible to allow the GC to reclaim any entities already visited, but I don't think\n 444 | that additional effort is worth it. */\n 445 | #ifndef NDEBUG\n 446 | assert (ddsi_thread_is_awake ());\n 447 | st->vtime = ddsrt_atomic_ld32 (&ddsi_lookup_thread_state ()->vtime);\n 448 | #endif\n 449 | st->entidx = (struct ddsi_entity_index *) ei;\n 450 | st->kind = min->entity.e.kind;\n 451 | ddsrt_mutex_lock (&st->entidx->all_entities_lock);\n 452 | st->cur = ddsrt_avl_lookup_succ_eq (&all_entities_treedef, &st->entidx->all_entities, min);\n 453 | ddsrt_mutex_unlock (&st->entidx->all_entities_lock);\n 454 | }\n 455 | \n 456 | void ddsi_entidx_enum_init_topic (struct ddsi_entity_enum *st, const struct ddsi_entity_index *ei, enum ddsi_entity_kind kind, const char *topic, struct ddsi_match_entities_range_key *max)\n 457 | {\n 458 | assert (kind == DDSI_EK_READER || kind == DDSI_EK_WRITER || kind == DDSI_EK_PROXY_READER || kind == DDSI_EK_PROXY_WRITER);\n 459 | struct ddsi_match_entities_range_key min;\n 460 | match_endpoint_range (kind, topic, &min, max);\n 461 | entidx_enum_init_minmax_int (st, ei, &min);\n 462 | if (st->cur && all_entities_compare (st->cur, &max->entity) > 0)\n 463 | st->cur = NULL;\n 464 | }\n 465 | \n 466 | void ddsi_entidx_enum_init_topic_w_prefix (struct ddsi_entity_enum *st, const struct ddsi_entity_index *ei, enum ddsi_entity_kind kind, const char *topic, const ddsi_guid_prefix_t *prefix, struct ddsi_match_entities_range_key *max)\n 467 | {\n 468 | assert (kind == DDSI_EK_READER || kind == DDSI_EK_WRITER || kind == DDSI_EK_PROXY_READER || kind == DDSI_EK_PROXY_WRITER);\n 469 | struct ddsi_match_entities_range_key min;\n 470 | match_endpoint_range (kind, topic, &min, max);\n 471 | min.entity.e.guid.prefix = *prefix;\n 472 | max->entity.e.guid.prefix = *prefix;\n 473 | entidx_enum_init_minmax_int (st, ei, &min);\n 474 | if (st->cur && all_entities_compare (st->cur, &max->entity) > 0)\n 475 | st->cur = NULL;\n 476 | }\n 477 | \n 478 | void ddsi_entidx_enum_init (struct ddsi_entity_enum *st, const struct ddsi_entity_index *ei, enum ddsi_entity_kind kind)\n 479 | {\n 480 | struct ddsi_match_entities_range_key min;\n 481 | match_entity_kind_min (kind, &min);\n 482 | entidx_enum_init_minmax_int (st, ei, &min);\n 483 | if (st->cur && st->cur->kind != st->kind)\n 484 | st->cur = NULL;\n 485 | }\n 486 | \n 487 | void ddsi_entidx_enum_writer_init (struct ddsi_entity_enum_writer *st, const struct ddsi_entity_index *ei)\n 488 | {\n 489 | ddsi_entidx_enum_init (&st->st, ei, DDSI_EK_WRITER);\n 490 | }", "src_commits": "[{\"path\":\"/src/cyclonedds\",\"rev\":\"3029b992768886f555dab44c6a33f40ab09cb225\",\"url\":\"https://github.com/eclipse-cyclonedds/cyclonedds\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_config_init\",\"fuzz_handle_rtps_message\",\"fuzz_handshake\",\"fuzz_sample_deser\",\"fuzz_type_object\"]", "cnt": 0, "coverage_keys": "[\"/src/cyclonedds/src/core/ddsi/src/ddsi_entity_index.c\"]", "target_text": "Reach line at /src/cyclonedds/src/core/ddsi/src/ddsi_entity_index.c:390 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-cyclonedds:v2026-07-test1@sha256:ebce3ee4f0439dc4137e4102d12d1b0958882af2e519a441e1203be06da72dfd", "runtime_digest": "sha256:ebce3ee4f0439dc4137e4102d12d1b0958882af2e519a441e1203be06da72dfd", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "hdf5:merged:src/hdf5/src/H5FO.c:580", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "hdf5", "harness": "merged", "harness_binaries": "[\"h5_extended_fuzzer\", \"h5_read_fuzzer\"]", "language": "c", "file": "/src/hdf5/src/H5FO.c", "line_start": 580, "line_end": 580, "line_count": 1, "function": "", "source_snippet": " 480 | FUNC_ENTER_NOAPI(FAIL)\n 481 | \n 482 | /* Sanity check */\n 483 | assert(f);\n 484 | assert(f->obj_count);\n 485 | assert(H5_addr_defined(addr));\n 486 | \n 487 | /* Get the object node from the container */\n 488 | if (NULL != (obj_count = (H5FO_obj_count_t *)H5SL_search(f->obj_count, &addr))) {\n 489 | /* Decrement the reference count for the object */\n 490 | (obj_count->count)--;\n 491 | \n 492 | if (obj_count->count == 0) {\n 493 | /* Remove from container */\n 494 | if (NULL == (obj_count = (H5FO_obj_count_t *)H5SL_remove(f->obj_count, &addr)))\n 495 | HGOTO_ERROR(H5E_CACHE, H5E_CANTRELEASE, FAIL, \"can't remove object from container\");\n 496 | \n 497 | /* Release the object information */\n 498 | obj_count = H5FL_FREE(H5FO_obj_count_t, obj_count);\n 499 | } /* end if */\n 500 | } /* end if */\n 501 | else\n 502 | HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, \"can't decrement ref. count\");\n 503 | \n 504 | done:\n 505 | FUNC_LEAVE_NOAPI(ret_value)\n 506 | } /* end H5FO_top_decr() */\n 507 | \n 508 | /*--------------------------------------------------------------------------\n 509 | NAME\n 510 | H5FO_top_count\n 511 | PURPOSE\n 512 | Return the \"top\" reference count for an object in a file\n 513 | USAGE\n 514 | hsize_t H5FO_top_count(f, addr)\n 515 | H5F_t *f; IN/OUT: File's opened object info set\n 516 | haddr_t addr; IN: Address of object to increment\n 517 | \n 518 | RETURNS\n 519 | Returns a non-negative on success, negative on failure\n 520 | DESCRIPTION\n 521 | Retrieves the reference count for an object in the opened object count set.\n 522 | GLOBAL VARIABLES\n 523 | COMMENTS, BUGS, ASSUMPTIONS\n 524 | EXAMPLES\n 525 | REVISION LOG\n 526 | --------------------------------------------------------------------------*/\n 527 | hsize_t\n 528 | H5FO_top_count(const H5F_t *f, haddr_t addr)\n 529 | {\n 530 | H5FO_obj_count_t *obj_count; /* Ref. count for object */\n 531 | hsize_t ret_value; /* Return value */\n 532 | \n 533 | FUNC_ENTER_NOAPI_NOINIT_NOERR\n 534 | \n 535 | /* Sanity check */\n 536 | assert(f);\n 537 | assert(f->obj_count);\n 538 | assert(H5_addr_defined(addr));\n 539 | \n 540 | /* Get the object node from the container */\n 541 | if (NULL != (obj_count = (H5FO_obj_count_t *)H5SL_search(f->obj_count, &addr)))\n 542 | ret_value = obj_count->count;\n 543 | else\n 544 | ret_value = 0;\n 545 | \n 546 | FUNC_LEAVE_NOAPI(ret_value)\n 547 | } /* end H5FO_top_count() */\n 548 | \n 549 | /*--------------------------------------------------------------------------\n 550 | NAME\n 551 | H5FO_top_dest\n 552 | PURPOSE\n 553 | Destroy an open object info set\n 554 | USAGE\n 555 | herr_t H5FO_top_dest(f)\n 556 | H5F_t *f; IN/OUT: File's opened object info set\n 557 | \n 558 | RETURNS\n 559 | Returns a non-negative on success, negative on failure\n 560 | DESCRIPTION\n 561 | Destroy an existing open object info set.\n 562 | GLOBAL VARIABLES\n 563 | COMMENTS, BUGS, ASSUMPTIONS\n 564 | EXAMPLES\n 565 | REVISION LOG\n 566 | --------------------------------------------------------------------------*/\n 567 | herr_t\n 568 | H5FO_top_dest(H5F_t *f)\n 569 | {\n 570 | herr_t ret_value = SUCCEED; /* Return value */\n 571 | \n 572 | FUNC_ENTER_NOAPI(FAIL)\n 573 | \n 574 | /* Sanity check */\n 575 | assert(f);\n 576 | assert(f->obj_count);\n 577 | \n 578 | /* Check if the object count set is empty */\n 579 | if (H5SL_count(f->obj_count) != 0)\n> 580 | HGOTO_ERROR(H5E_CACHE, H5E_CANTRELEASE, FAIL, \"objects still in open object info set\");\n 581 | \n 582 | /* Release the open object count set container */\n 583 | if (H5SL_close(f->obj_count) < 0)\n 584 | HGOTO_ERROR(H5E_CACHE, H5E_CANTCLOSEOBJ, FAIL, \"can't close open object info set\");\n 585 | \n 586 | f->obj_count = NULL;\n 587 | \n 588 | done:\n 589 | FUNC_LEAVE_NOAPI(ret_value)\n 590 | } /* end H5FO_top_dest() */", "src_commits": "[{\"path\":\"/src/hdf5\",\"rev\":\"6e6273e573034090378278891a14f2cc03bb5adf\",\"url\":\"https://github.com/HDFGroup/hdf5\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"h5_extended_fuzzer\",\"h5_read_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/hdf5/src/H5FO.c\"]", "target_text": "Reach line at /src/hdf5/src/H5FO.c:580 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-hdf5:v2026-07-test1@sha256:23dac6e302371f1fa5341a1e54d537d41168b125a39a1e902464700daaae91a6", "runtime_digest": "sha256:23dac6e302371f1fa5341a1e54d537d41168b125a39a1e902464700daaae91a6", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "hdf5:merged:src/hdf5/src/H5AC.c:691", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "hdf5", "harness": "merged", "harness_binaries": "[\"h5_extended_fuzzer\", \"h5_read_fuzzer\"]", "language": "c", "file": "/src/hdf5/src/H5AC.c", "line_start": 691, "line_end": 691, "line_count": 1, "function": "", "source_snippet": " 591 | assert(H5_addr_defined(addr));\n 592 | \n 593 | if (H5C_expunge_entry(f, type, addr, flags) < 0)\n 594 | HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, \"H5C_expunge_entry() failed\");\n 595 | \n 596 | done:\n 597 | /* If currently logging, generate a message */\n 598 | if (f->shared->cache->log_info->logging)\n 599 | if (H5C_log_write_expunge_entry_msg(f->shared->cache, addr, type->id, ret_value) < 0)\n 600 | HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, \"unable to emit log message\");\n 601 | \n 602 | FUNC_LEAVE_NOAPI(ret_value)\n 603 | } /* H5AC_expunge_entry() */\n 604 | \n 605 | /*-------------------------------------------------------------------------\n 606 | * Function: H5AC_flush\n 607 | *\n 608 | * Purpose: Flush (and possibly destroy) the metadata cache associated\n 609 | * with the specified file.\n 610 | *\n 611 | * If the cache contains protected entries, the function will\n 612 | * fail, as protected entries cannot be flushed. However\n 613 | * all unprotected entries should be flushed before the\n 614 | * function returns failure.\n 615 | *\n 616 | * Return: Non-negative on success/Negative on failure if there was a\n 617 | * request to flush all items and something was protected.\n 618 | *\n 619 | *-------------------------------------------------------------------------\n 620 | */\n 621 | herr_t\n 622 | H5AC_flush(H5F_t *f)\n 623 | {\n 624 | herr_t ret_value = SUCCEED; /* Return value */\n 625 | \n 626 | FUNC_ENTER_NOAPI(FAIL)\n 627 | \n 628 | /* Sanity checks */\n 629 | assert(f);\n 630 | assert(f->shared);\n 631 | assert(f->shared->cache);\n 632 | \n 633 | #ifdef H5_HAVE_PARALLEL\n 634 | /* flushing the cache, so clear all collective entries */\n 635 | if (H5C_clear_coll_entries(f->shared->cache, false) < 0)\n 636 | HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, \"H5C_clear_coll_entries() failed\");\n 637 | \n 638 | /* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */\n 639 | if (H5AC__flush_entries(f) < 0)\n 640 | HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \"Can't flush\");\n 641 | #endif /* H5_HAVE_PARALLEL */\n 642 | \n 643 | /* Flush the cache */\n 644 | /* (Again, in parallel - writes out the superblock) */\n 645 | if (H5C_flush_cache(f, H5AC__NO_FLAGS_SET) < 0)\n 646 | HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \"Can't flush cache\");\n 647 | \n 648 | done:\n 649 | /* If currently logging, generate a message */\n 650 | if (f->shared->cache->log_info->logging)\n 651 | if (H5C_log_write_flush_cache_msg(f->shared->cache, ret_value) < 0)\n 652 | HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, \"unable to emit log message\");\n 653 | \n 654 | FUNC_LEAVE_NOAPI(ret_value)\n 655 | } /* H5AC_flush() */\n 656 | \n 657 | /*-------------------------------------------------------------------------\n 658 | * Function: H5AC_get_entry_status\n 659 | *\n 660 | * Purpose: Given a file address, determine whether the metadata\n 661 | * cache contains an entry at that location. If it does,\n 662 | * also determine whether the entry is dirty, protected,\n 663 | * pinned, etc. and return that information to the caller\n 664 | * in *status.\n 665 | *\n 666 | * If the specified entry doesn't exist, set *status_ptr\n 667 | * to zero.\n 668 | *\n 669 | * On error, the value of *status is undefined.\n 670 | *\n 671 | * Return: Non-negative on success/Negative on failure\n 672 | *\n 673 | *-------------------------------------------------------------------------\n 674 | */\n 675 | herr_t\n 676 | H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status)\n 677 | {\n 678 | bool in_cache; /* Entry @ addr is in the cache */\n 679 | bool is_dirty; /* Entry @ addr is in the cache and dirty */\n 680 | bool is_protected; /* Entry @ addr is in the cache and protected */\n 681 | bool is_pinned; /* Entry @ addr is in the cache and pinned */\n 682 | bool is_corked;\n 683 | bool is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */\n 684 | bool is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */\n 685 | bool image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */\n 686 | herr_t ret_value = SUCCEED; /* Return value */\n 687 | \n 688 | FUNC_ENTER_NOAPI(FAIL)\n 689 | \n 690 | if ((f == NULL) || (!H5_addr_defined(addr)) || (status == NULL))\n> 691 | HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \"Bad param(s) on entry\");\n 692 | \n 693 | if (H5C_get_entry_status(f, addr, NULL, &in_cache, &is_dirty, &is_protected, &is_pinned, &is_corked,\n 694 | &is_flush_dep_parent, &is_flush_dep_child, &image_is_up_to_date) < 0)\n 695 | HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \"H5C_get_entry_status() failed\");\n 696 | \n 697 | if (in_cache) {\n 698 | *status |= H5AC_ES__IN_CACHE;\n 699 | if (is_dirty)\n 700 | *status |= H5AC_ES__IS_DIRTY;\n 701 | if (is_protected)\n 702 | *status |= H5AC_ES__IS_PROTECTED;\n 703 | if (is_pinned)\n 704 | *status |= H5AC_ES__IS_PINNED;\n 705 | if (is_corked)\n 706 | *status |= H5AC_ES__IS_CORKED;\n 707 | if (is_flush_dep_parent)\n 708 | *status |= H5AC_ES__IS_FLUSH_DEP_PARENT;\n 709 | if (is_flush_dep_child)\n 710 | *status |= H5AC_ES__IS_FLUSH_DEP_CHILD;\n 711 | if (image_is_up_to_date)\n 712 | *status |= H5AC_ES__IMAGE_IS_UP_TO_DATE;\n 713 | } /* end if */\n 714 | else\n 715 | *status = 0;\n 716 | \n 717 | done:\n 718 | FUNC_LEAVE_NOAPI(ret_value)\n 719 | } /* H5AC_get_entry_status() */\n 720 | \n 721 | /*-------------------------------------------------------------------------\n 722 | * Function: H5AC_insert_entry\n 723 | *\n 724 | * Purpose: Adds the specified thing to the cache. The thing need not\n 725 | * exist on disk yet, but it must have an address and disk\n 726 | * space reserved.\n 727 | *\n 728 | * Return: Non-negative on success/Negative on failure\n 729 | *\n 730 | *-------------------------------------------------------------------------\n 731 | */\n 732 | herr_t\n 733 | H5AC_insert_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags)\n 734 | {\n 735 | herr_t ret_value = SUCCEED; /* Return value */\n 736 | \n 737 | FUNC_ENTER_NOAPI(FAIL)\n 738 | \n 739 | /* Sanity checks */\n 740 | assert(f);\n 741 | assert(f->shared);\n 742 | assert(f->shared->cache);\n 743 | assert(type);\n 744 | assert(type->serialize);\n 745 | assert(H5_addr_defined(addr));\n 746 | assert(thing);\n 747 | \n 748 | /* Check for invalid access request */\n 749 | if (0 == (H5F_INTENT(f) & H5F_ACC_RDWR))\n 750 | HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, \"no write intent on file\");\n 751 | \n 752 | #if H5AC_DO_TAGGING_SANITY_CHECKS\n 753 | if (!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(type) < 0)\n 754 | HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, \"Bad tag value\");\n 755 | #endif /* H5AC_DO_TAGGING_SANITY_CHECKS */\n 756 | \n 757 | /* Insert entry into metadata cache */\n 758 | if (H5C_insert_entry(f, type, addr, thing, flags) < 0)\n 759 | HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, \"H5C_insert_entry() failed\");\n 760 | \n 761 | #ifdef H5_HAVE_PARALLEL\n 762 | {\n 763 | H5AC_aux_t *aux_ptr;\n 764 | \n 765 | if (NULL != (aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache))) {\n 766 | /* Log the new entry */\n 767 | if (H5AC__log_inserted_entry((H5AC_info_t *)thing) < 0)\n 768 | HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, \"H5AC__log_inserted_entry() failed\");\n 769 | \n 770 | /* Check if we should try to flush */\n 771 | if (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)\n 772 | if (H5AC__run_sync_point(f, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)\n 773 | HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \"Can't run sync point\");\n 774 | } /* end if */\n 775 | }\n 776 | #endif /* H5_HAVE_PARALLEL */\n 777 | \n 778 | done:\n 779 | /* If currently logging, generate a message */\n 780 | if (f->shared->cache->log_info->logging)\n 781 | if (H5C_log_write_insert_entry_msg(f->shared->cache, addr, type->id, flags,\n 782 | ((H5C_cache_entry_t *)thing)->size, ret_value) < 0)\n 783 | HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, \"unable to emit log message\");\n 784 | \n 785 | FUNC_LEAVE_NOAPI(ret_value)\n 786 | } /* H5AC_insert_entry() */\n 787 | \n 788 | /*-------------------------------------------------------------------------\n 789 | * Function: H5AC_load_cache_image_on_next_protect\n 790 | *\n 791 | * Purpose: Load the cache image block at the specified location,", "src_commits": "[{\"path\":\"/src/hdf5\",\"rev\":\"6e6273e573034090378278891a14f2cc03bb5adf\",\"url\":\"https://github.com/HDFGroup/hdf5\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"h5_extended_fuzzer\",\"h5_read_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/hdf5/src/H5AC.c\"]", "target_text": "Reach line at /src/hdf5/src/H5AC.c:691 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-hdf5:v2026-07-test1@sha256:23dac6e302371f1fa5341a1e54d537d41168b125a39a1e902464700daaae91a6", "runtime_digest": "sha256:23dac6e302371f1fa5341a1e54d537d41168b125a39a1e902464700daaae91a6", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "hdf5:merged:src/hdf5/src/H5Faccum.c:157", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "hdf5", "harness": "merged", "harness_binaries": "[\"h5_extended_fuzzer\", \"h5_read_fuzzer\"]", "language": "c", "file": "/src/hdf5/src/H5Faccum.c", "line_start": 157, "line_end": 157, "line_count": 1, "function": "", "source_snippet": " 57 | H5F_ACCUM_APPEND /* Data will be appended to accumulator */\n 58 | } H5F_accum_adjust_t;\n 59 | \n 60 | /********************/\n 61 | /* Package Typedefs */\n 62 | /********************/\n 63 | \n 64 | /********************/\n 65 | /* Local Prototypes */\n 66 | /********************/\n 67 | \n 68 | /*********************/\n 69 | /* Package Variables */\n 70 | /*********************/\n 71 | \n 72 | /*****************************/\n 73 | /* Library Private Variables */\n 74 | /*****************************/\n 75 | \n 76 | /*******************/\n 77 | /* Local Variables */\n 78 | /*******************/\n 79 | \n 80 | /* Declare a PQ free list to manage the metadata accumulator buffer */\n 81 | H5FL_BLK_DEFINE_STATIC(meta_accum);\n 82 | \n 83 | /*-------------------------------------------------------------------------\n 84 | * Function:\tH5F__accum_read\n 85 | *\n 86 | * Purpose:\tAttempts to read some data from the metadata accumulator for\n 87 | * a file into a buffer.\n 88 | *\n 89 | * Note:\tWe can't change (or add to) the metadata accumulator, because\n 90 | *\t\tthis might be a speculative read and could possibly read raw\n 91 | *\t\tdata into the metadata accumulator.\n 92 | *\n 93 | * Return:\tNon-negative on success/Negative on failure\n 94 | *\n 95 | *-------------------------------------------------------------------------\n 96 | */\n 97 | herr_t\n 98 | H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t size, void *buf /*out*/)\n 99 | {\n 100 | H5FD_t *file; /* File driver pointer */\n 101 | herr_t ret_value = SUCCEED; /* Return value */\n 102 | \n 103 | FUNC_ENTER_PACKAGE\n 104 | \n 105 | /* Sanity checks */\n 106 | assert(f_sh);\n 107 | assert(buf);\n 108 | \n 109 | /* Translate to file driver I/O info object */\n 110 | file = f_sh->lf;\n 111 | \n 112 | /* Check if this information is in the metadata accumulator */\n 113 | if ((f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) {\n 114 | H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */\n 115 | \n 116 | /* Set up alias for file's metadata accumulator info */\n 117 | accum = &f_sh->accum;\n 118 | \n 119 | if (size < H5F_ACCUM_MAX_SIZE) {\n 120 | /* Sanity check */\n 121 | assert(!accum->buf || (accum->alloc_size >= accum->size));\n 122 | \n 123 | /* Current read adjoins or overlaps with metadata accumulator */\n 124 | if (H5_addr_defined(accum->loc) &&\n 125 | (H5_addr_overlap(addr, size, accum->loc, accum->size) || ((addr + size) == accum->loc) ||\n 126 | (accum->loc + accum->size) == addr)) {\n 127 | size_t amount_before; /* Amount to read before current accumulator */\n 128 | haddr_t new_addr; /* New address of the accumulator buffer */\n 129 | size_t new_size; /* New size of the accumulator buffer */\n 130 | \n 131 | /* Compute new values for accumulator */\n 132 | new_addr = MIN(addr, accum->loc);\n 133 | new_size = (size_t)(MAX((addr + size), (accum->loc + accum->size)) - new_addr);\n 134 | \n 135 | /* Check if we need more buffer space */\n 136 | if (new_size > accum->alloc_size) {\n 137 | size_t new_alloc_size; /* New size of accumulator */\n 138 | \n 139 | /* Adjust the buffer size to be a power of 2 that is large enough to hold data */\n 140 | new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(new_size - 1)));\n 141 | \n 142 | /* Reallocate the metadata accumulator buffer */\n 143 | if (NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size)))\n 144 | HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,\n 145 | \"unable to allocate metadata accumulator buffer\");\n 146 | \n 147 | /* Note the new buffer size */\n 148 | accum->alloc_size = new_alloc_size;\n 149 | \n 150 | /* Clear the memory */\n 151 | memset(accum->buf + accum->size, 0, (accum->alloc_size - accum->size));\n 152 | } /* end if */\n 153 | \n 154 | /* Read the part before the metadata accumulator */\n 155 | if (addr < accum->loc) {\n 156 | /* Set the amount to read */\n> 157 | H5_CHECKED_ASSIGN(amount_before, size_t, (accum->loc - addr), hsize_t);\n 158 | \n 159 | /* Make room for the metadata to read in */\n 160 | memmove(accum->buf + amount_before, accum->buf, accum->size);\n 161 | \n 162 | /* Adjust dirty region tracking info, if present */\n 163 | if (accum->dirty)\n 164 | accum->dirty_off += amount_before;\n 165 | \n 166 | /* Dispatch to driver */\n 167 | if (H5FD_read(file, map_type, addr, amount_before, accum->buf) < 0)\n 168 | HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, \"driver read request failed\");\n 169 | } /* end if */\n 170 | else\n 171 | amount_before = 0;\n 172 | \n 173 | /* Read the part after the metadata accumulator */\n 174 | if ((addr + size) > (accum->loc + accum->size)) {\n 175 | size_t amount_after; /* Amount to read at a time */\n 176 | \n 177 | /* Set the amount to read */\n 178 | H5_CHECKED_ASSIGN(amount_after, size_t, ((addr + size) - (accum->loc + accum->size)),\n 179 | hsize_t);\n 180 | \n 181 | /* Dispatch to driver */\n 182 | if (H5FD_read(file, map_type, (accum->loc + accum->size), amount_after,\n 183 | (accum->buf + accum->size + amount_before)) < 0)\n 184 | HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, \"driver read request failed\");\n 185 | } /* end if */\n 186 | \n 187 | /* Copy the data out of the buffer */\n 188 | H5MM_memcpy(buf, accum->buf + (addr - new_addr), size);\n 189 | \n 190 | /* Adjust the accumulator address & size */\n 191 | accum->loc = new_addr;\n 192 | accum->size = new_size;\n 193 | } /* end if */\n 194 | /* Current read doesn't overlap with metadata accumulator, read it from file */\n 195 | else {\n 196 | /* Dispatch to driver */\n 197 | if (H5FD_read(file, map_type, addr, size, buf) < 0)\n 198 | HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, \"driver read request failed\");\n 199 | } /* end else */\n 200 | } /* end if */\n 201 | else {\n 202 | /* Read the data */\n 203 | if (H5FD_read(file, map_type, addr, size, buf) < 0)\n 204 | HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, \"driver read request failed\");\n 205 | \n 206 | /* Check for overlap w/dirty accumulator */\n 207 | /* (Note that this could be improved by updating the non-dirty\n 208 | * information in the accumulator with [some of] the information\n 209 | * just read in. -QAK)\n 210 | */\n 211 | if (accum->dirty &&\n 212 | H5_addr_overlap(addr, size, accum->loc + accum->dirty_off, accum->dirty_len)) {\n 213 | haddr_t dirty_loc = accum->loc + accum->dirty_off; /* File offset of dirty information */\n 214 | size_t buf_off; /* Offset of dirty region in buffer */\n 215 | size_t dirty_off; /* Offset within dirty region */\n 216 | size_t overlap_size; /* Size of overlap with dirty region */\n 217 | \n 218 | /* Check for read starting before beginning dirty region */\n 219 | if (H5_addr_le(addr, dirty_loc)) {\n 220 | /* Compute offset of dirty region within buffer */\n 221 | buf_off = (size_t)(dirty_loc - addr);\n 222 | \n 223 | /* Compute offset within dirty region */\n 224 | dirty_off = 0;\n 225 | \n 226 | /* Check for read ending within dirty region */\n 227 | if (H5_addr_lt(addr + size, dirty_loc + accum->dirty_len))\n 228 | overlap_size = (size_t)((addr + size) - buf_off);\n 229 | else /* Access covers whole dirty region */\n 230 | overlap_size = accum->dirty_len;\n 231 | } /* end if */\n 232 | else { /* Read starts after beginning of dirty region */\n 233 | /* Compute dirty offset within buffer and overlap size */\n 234 | buf_off = 0;\n 235 | dirty_off = (size_t)(addr - dirty_loc);\n 236 | overlap_size = (size_t)((dirty_loc + accum->dirty_len) - addr);\n 237 | } /* end else */\n 238 | \n 239 | /* Copy the dirty region to buffer */\n 240 | H5MM_memcpy((unsigned char *)buf + buf_off,\n 241 | (unsigned char *)accum->buf + accum->dirty_off + dirty_off, overlap_size);\n 242 | } /* end if */\n 243 | } /* end else */\n 244 | } /* end if */\n 245 | else {\n 246 | /* Read the data */\n 247 | if (H5FD_read(file, map_type, addr, size, buf) < 0)\n 248 | HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, \"driver read request failed\");\n 249 | } /* end else */\n 250 | \n 251 | done:\n 252 | FUNC_LEAVE_NOAPI(ret_value)\n 253 | } /* end H5F__accum_read() */\n 254 | \n 255 | /*-------------------------------------------------------------------------\n 256 | * Function:\tH5F__accum_adjust\n 257 | *", "src_commits": "[{\"path\":\"/src/hdf5\",\"rev\":\"6e6273e573034090378278891a14f2cc03bb5adf\",\"url\":\"https://github.com/HDFGroup/hdf5\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"h5_extended_fuzzer\",\"h5_read_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/hdf5/src/H5Faccum.c\"]", "target_text": "Reach line at /src/hdf5/src/H5Faccum.c:157 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-hdf5:v2026-07-test1@sha256:23dac6e302371f1fa5341a1e54d537d41168b125a39a1e902464700daaae91a6", "runtime_digest": "sha256:23dac6e302371f1fa5341a1e54d537d41168b125a39a1e902464700daaae91a6", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "hdf5:merged:src/hdf5/src/H5.c:286", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "hdf5", "harness": "merged", "harness_binaries": "[\"h5_extended_fuzzer\", \"h5_read_fuzzer\"]", "language": "c", "file": "/src/hdf5/src/H5.c", "line_start": 286, "line_end": 286, "line_count": 1, "function": "", "source_snippet": " 186 | \n 187 | if (MPI_SUCCESS != (mpi_code = MPI_Comm_free_keyval(&key_val)))\n 188 | HMPI_GOTO_ERROR(FAIL, \"MPI_Comm_free_keyval failed\", mpi_code)\n 189 | }\n 190 | }\n 191 | #endif /*H5_HAVE_PARALLEL*/\n 192 | \n 193 | /*\n 194 | * Make sure the package information is updated.\n 195 | */\n 196 | memset(&H5_debug_g, 0, sizeof H5_debug_g);\n 197 | H5_debug_g.pkg[H5_PKG_A].name = \"a\";\n 198 | H5_debug_g.pkg[H5_PKG_AC].name = \"ac\";\n 199 | H5_debug_g.pkg[H5_PKG_B].name = \"b\";\n 200 | H5_debug_g.pkg[H5_PKG_D].name = \"d\";\n 201 | H5_debug_g.pkg[H5_PKG_E].name = \"e\";\n 202 | H5_debug_g.pkg[H5_PKG_F].name = \"f\";\n 203 | H5_debug_g.pkg[H5_PKG_G].name = \"g\";\n 204 | H5_debug_g.pkg[H5_PKG_HG].name = \"hg\";\n 205 | H5_debug_g.pkg[H5_PKG_HL].name = \"hl\";\n 206 | H5_debug_g.pkg[H5_PKG_I].name = \"i\";\n 207 | H5_debug_g.pkg[H5_PKG_M].name = \"m\";\n 208 | H5_debug_g.pkg[H5_PKG_MF].name = \"mf\";\n 209 | H5_debug_g.pkg[H5_PKG_MM].name = \"mm\";\n 210 | H5_debug_g.pkg[H5_PKG_O].name = \"o\";\n 211 | H5_debug_g.pkg[H5_PKG_P].name = \"p\";\n 212 | H5_debug_g.pkg[H5_PKG_S].name = \"s\";\n 213 | H5_debug_g.pkg[H5_PKG_T].name = \"t\";\n 214 | H5_debug_g.pkg[H5_PKG_V].name = \"v\";\n 215 | H5_debug_g.pkg[H5_PKG_VL].name = \"vl\";\n 216 | H5_debug_g.pkg[H5_PKG_Z].name = \"z\";\n 217 | \n 218 | /*\n 219 | * Install atexit() library cleanup routines unless the H5dont_atexit()\n 220 | * has been called. Once we add something to the atexit() list it stays\n 221 | * there permanently, so we set H5_dont_atexit_g after we add it to prevent\n 222 | * adding it again later if the library is closed and reopened.\n 223 | */\n 224 | if (!H5_dont_atexit_g) {\n 225 | \n 226 | #ifdef H5_HAVE_THREADSAFE_API\n 227 | /* Clean up thread resources.\n 228 | *\n 229 | * This must be pushed before the library cleanup code so it's\n 230 | * executed in LIFO order (i.e., last).\n 231 | */\n 232 | (void)atexit(H5TS_term_package);\n 233 | #endif /* H5_HAVE_THREADSAFE_API */\n 234 | \n 235 | /* Normal library termination code */\n 236 | (void)atexit(H5_term_library);\n 237 | \n 238 | H5_dont_atexit_g = true;\n 239 | } /* end if */\n 240 | \n 241 | /*\n 242 | * Initialize interfaces that use macros of the form \"(H5OPEN )\", so\n 243 | * that the variable returned through the macros has been initialized.\n 244 | * Also initialize some interfaces that might not be able to initialize\n 245 | * themselves soon enough.\n 246 | *\n 247 | * Interfaces returning variables through a macro: H5E, H5FD, H5O, H5P, H5T\n 248 | *\n 249 | * The link interface needs to be initialized so that the external link\n 250 | * class is registered.\n 251 | *\n 252 | * The FS module needs to be initialized as a result of the fix for HDFFV-10160:\n 253 | * It might not be initialized during normal file open.\n 254 | * When the application does not close the file, routines in the module might\n 255 | * be called via H5_term_library() when shutting down the file.\n 256 | *\n 257 | * The dataspace interface needs to be initialized so that future IDs for\n 258 | * dataspaces work.\n 259 | *\n 260 | * The VFD & VOL interfaces need to be initialized before the H5P interface\n 261 | * so that the default VFD and default VOL connector are ready for the\n 262 | * default FAPL.\n 263 | *\n 264 | */\n 265 | if (H5E_init() < 0)\n 266 | HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, \"unable to initialize error interface\");\n 267 | if (H5FD_init() < 0)\n 268 | HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, \"unable to initialize VFL interface\");\n 269 | if (H5VL_init_phase1() < 0)\n 270 | HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, \"unable to initialize vol interface\");\n 271 | if (H5P_init_phase1() < 0)\n 272 | HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, \"unable to initialize property list interface\");\n 273 | if (H5L_init() < 0)\n 274 | HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, \"unable to initialize link interface\");\n 275 | if (H5O_init() < 0)\n 276 | HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, \"unable to initialize object interface\");\n 277 | if (H5FS_init() < 0)\n 278 | HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, \"unable to initialize FS interface\");\n 279 | if (H5S_init() < 0)\n 280 | HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, \"unable to initialize dataspace interface\");\n 281 | if (H5T_init() < 0)\n 282 | HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, \"unable to initialize datatype interface\");\n 283 | \n 284 | /* Finish initializing interfaces that depend on the interfaces above */\n 285 | if (H5P_init_phase2() < 0)\n> 286 | HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, \"unable to initialize property list interface\");\n 287 | if (H5VL_init_phase2() < 0)\n 288 | HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, \"unable to initialize vol interface\");\n 289 | \n 290 | /* Debugging? */\n 291 | H5__debug_mask(\"-all\");\n 292 | H5__debug_mask(getenv(\"HDF5_DEBUG\"));\n 293 | \n 294 | done:\n 295 | FUNC_LEAVE_NOAPI(ret_value)\n 296 | } /* end H5_init_library() */\n 297 | \n 298 | /*-------------------------------------------------------------------------\n 299 | * Function: H5_term_library\n 300 | *\n 301 | * Purpose: Terminate interfaces in a well-defined order due to\n 302 | * dependencies among the interfaces, then terminate\n 303 | * library-specific data.\n 304 | *\n 305 | * Return: void\n 306 | *\n 307 | *-------------------------------------------------------------------------\n 308 | */\n 309 | void\n 310 | H5_term_library(void)\n 311 | {\n 312 | int pending, ntries = 0, n;\n 313 | size_t at = 0;\n 314 | char loop[1024];\n 315 | H5E_auto2_t func;\n 316 | H5CX_node_t api_ctx = {{0}, NULL}; /* API context node to push */\n 317 | \n 318 | /* Acquire the API lock */\n 319 | H5_API_SETUP_PUBLIC_API_VARS\n 320 | H5_API_LOCK\n 321 | \n 322 | /* Don't do anything if the library is already closed */\n 323 | if (!H5_INIT_GLOBAL)\n 324 | goto done;\n 325 | \n 326 | /* Indicate that the library is being shut down */\n 327 | H5_TERM_GLOBAL = true;\n 328 | \n 329 | /* Push the API context without checking for errors */\n 330 | H5CX_push(&api_ctx);\n 331 | \n 332 | /* Check if we should display error output */\n 333 | (void)H5E_get_default_auto_func(&func);\n 334 | \n 335 | /* Iterate over the list of 'atclose' callbacks that have been registered */\n 336 | if (H5_atclose_head) {\n 337 | H5_atclose_node_t *curr_atclose; /* Current 'atclose' node */\n 338 | \n 339 | /* Iterate over all 'atclose' nodes, making callbacks */\n 340 | curr_atclose = H5_atclose_head;\n 341 | while (curr_atclose) {\n 342 | H5_atclose_node_t *tmp_atclose; /* Temporary pointer to 'atclose' node */\n 343 | \n 344 | /* Prepare & restore library for user callback */\n 345 | H5_BEFORE_USER_CB_NOCHECK\n 346 | {\n 347 | /* Invoke callback, providing context */\n 348 | (*curr_atclose->func)(curr_atclose->ctx);\n 349 | }\n 350 | H5_AFTER_USER_CB_NOCHECK\n 351 | \n 352 | /* Advance to next node and free this one */\n 353 | tmp_atclose = curr_atclose;\n 354 | curr_atclose = curr_atclose->next;\n 355 | H5FL_FREE(H5_atclose_node_t, tmp_atclose);\n 356 | } /* end while */\n 357 | \n 358 | /* Reset list head, in case library is re-initialized */\n 359 | H5_atclose_head = NULL;\n 360 | } /* end if */\n 361 | \n 362 | /*\n 363 | * Terminate each interface. The termination functions return a positive\n 364 | * value if they do something that might affect some other interface in a\n 365 | * way that would necessitate some cleanup work in the other interface.\n 366 | */\n 367 | #define DOWN(F) \\\n 368 | (((n = H5##F##_term_package()) && (at + 8) < sizeof loop) \\\n 369 | ? (sprintf(loop + at, \"%s%s\", (at ? \",\" : \"\"), #F), at += strlen(loop + at), n) \\\n 370 | : ((n > 0 && (at + 5) < sizeof loop) ? (sprintf(loop + at, \"...\"), at += strlen(loop + at), n) \\\n 371 | : n))\n 372 | \n 373 | do {\n 374 | pending = 0;\n 375 | \n 376 | /* Try to organize these so the \"higher\" level components get shut\n 377 | * down before \"lower\" level components that they might rely on. -QAK\n 378 | */\n 379 | \n 380 | /* Close the event sets first, so that all asynchronous operations\n 381 | * complete before anything else attempts to shut down.\n 382 | */\n 383 | pending += DOWN(ES);\n 384 | \n 385 | /* Close down the user-facing interfaces, after the event sets */\n 386 | if (pending == 0) {", "src_commits": "[{\"path\":\"/src/hdf5\",\"rev\":\"6e6273e573034090378278891a14f2cc03bb5adf\",\"url\":\"https://github.com/HDFGroup/hdf5\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"h5_extended_fuzzer\",\"h5_read_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/hdf5/src/H5.c\"]", "target_text": "Reach line at /src/hdf5/src/H5.c:286 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-hdf5:v2026-07-test1@sha256:23dac6e302371f1fa5341a1e54d537d41168b125a39a1e902464700daaae91a6", "runtime_digest": "sha256:23dac6e302371f1fa5341a1e54d537d41168b125a39a1e902464700daaae91a6", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "hdf5:merged:src/hdf5/src/H5MF.c:885", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "hdf5", "harness": "merged", "harness_binaries": "[\"h5_extended_fuzzer\", \"h5_read_fuzzer\"]", "language": "c", "file": "/src/hdf5/src/H5MF.c", "line_start": 885, "line_end": 885, "line_count": 1, "function": "", "source_snippet": " 785 | \"attempt to notify cache that ring is unsettled failed\");\n 786 | \n 787 | /* Check if the free space manager for the file has been initialized */\n 788 | if (!f->shared->fs_man[fs_type] && H5_addr_defined(f->shared->fs_addr[fs_type])) {\n 789 | /* Open the free-space manager */\n 790 | if (H5MF__open_fstype(f, fs_type) < 0)\n 791 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTOPENOBJ, HADDR_UNDEF, \"can't initialize file free space\");\n 792 | assert(f->shared->fs_man[fs_type]);\n 793 | } /* end if */\n 794 | \n 795 | /* Search for large enough space in the free space manager */\n 796 | if (f->shared->fs_man[fs_type])\n 797 | if (H5MF__find_sect(f, alloc_type, size, f->shared->fs_man[fs_type], &ret_value) < 0)\n 798 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, \"error locating a node\");\n 799 | } /* end if */\n 800 | \n 801 | /* If no space is found from the free-space manager, continue further action */\n 802 | if (!H5_addr_defined(ret_value)) {\n 803 | #ifdef H5MF_ALLOC_DEBUG_MORE\n 804 | fprintf(stderr, \"%s: Check 2.0\\n\", __func__);\n 805 | #endif /* H5MF_ALLOC_DEBUG_MORE */\n 806 | if (f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE) {\n 807 | assert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN);\n 808 | if (HADDR_UNDEF == (ret_value = H5MF__alloc_pagefs(f, alloc_type, size)))\n 809 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF,\n 810 | \"allocation failed from paged aggregation\");\n 811 | } /* end if */\n 812 | else { /* For non-paged aggregation, continue further action */\n 813 | if (HADDR_UNDEF == (ret_value = H5MF_aggr_vfd_alloc(f, alloc_type, size)))\n 814 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, \"allocation failed from aggr/vfd\");\n 815 | } /* end else */\n 816 | } /* end if */\n 817 | assert(H5_addr_defined(ret_value));\n 818 | #ifdef H5MF_ALLOC_DEBUG_MORE\n 819 | fprintf(stderr, \"%s: Check 3.0\\n\", __func__);\n 820 | #endif /* H5MF_ALLOC_DEBUG_MORE */\n 821 | \n 822 | done:\n 823 | /* Reset the ring in the API context */\n 824 | if (orig_ring != H5AC_RING_INV)\n 825 | H5AC_set_ring(orig_ring, NULL);\n 826 | \n 827 | #ifdef H5MF_ALLOC_DEBUG\n 828 | fprintf(stderr, \"%s: Leaving: ret_value = %\" PRIuHADDR \", size = %\" PRIuHSIZE \"\\n\", __func__, ret_value,\n 829 | size);\n 830 | #endif /* H5MF_ALLOC_DEBUG */\n 831 | #ifdef H5MF_ALLOC_DEBUG_DUMP\n 832 | H5MF__sects_dump(f, stderr);\n 833 | #endif /* H5MF_ALLOC_DEBUG_DUMP */\n 834 | \n 835 | FUNC_LEAVE_NOAPI_TAG(ret_value)\n 836 | } /* end H5MF_alloc() */\n 837 | \n 838 | /*-------------------------------------------------------------------------\n 839 | * Function: H5MF__alloc_pagefs\n 840 | *\n 841 | * Purpose: Allocate space from either the large or small free-space manager.\n 842 | * For \"large\" request:\n 843 | * Allocate request from VFD\n 844 | * Determine mis-aligned fragment and return the fragment to the\n 845 | * appropriate manager\n 846 | * For \"small\" request:\n 847 | * Allocate a page from the large manager\n 848 | * Determine whether space is available from a mis-aligned fragment\n 849 | * being returned to the manager\n 850 | * Return left-over space to the manager after fulfilling request\n 851 | *\n 852 | * Return: Success: The file address of new chunk.\n 853 | * Failure: HADDR_UNDEF\n 854 | *\n 855 | *-------------------------------------------------------------------------\n 856 | */\n 857 | static haddr_t\n 858 | H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)\n 859 | {\n 860 | H5F_mem_page_t ptype; /* Free-space manager type */\n 861 | H5MF_free_section_t *node = NULL; /* Free space section pointer */\n 862 | bool section_merged_or_shrunk = false; /* Whether free space section was merged or shrunk away */\n 863 | haddr_t ret_value = HADDR_UNDEF; /* Return value */\n 864 | \n 865 | FUNC_ENTER_PACKAGE\n 866 | \n 867 | #ifdef H5MF_ALLOC_DEBUG\n 868 | fprintf(stderr, \"%s: alloc_type = %u, size = %\" PRIuHSIZE \"\\n\", __func__, (unsigned)alloc_type, size);\n 869 | #endif /* H5MF_ALLOC_DEBUG */\n 870 | \n 871 | H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &ptype);\n 872 | \n 873 | switch (ptype) {\n 874 | case H5F_MEM_PAGE_GENERIC:\n 875 | case H5F_MEM_PAGE_LARGE_BTREE:\n 876 | case H5F_MEM_PAGE_LARGE_DRAW:\n 877 | case H5F_MEM_PAGE_LARGE_GHEAP:\n 878 | case H5F_MEM_PAGE_LARGE_LHEAP:\n 879 | case H5F_MEM_PAGE_LARGE_OHDR: {\n 880 | haddr_t eoa; /* EOA for the file */\n 881 | hsize_t frag_size = 0; /* Fragment size */\n 882 | \n 883 | /* Get the EOA for the file */\n 884 | if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, alloc_type)))\n> 885 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, HADDR_UNDEF, \"Unable to get eoa\");\n 886 | assert(!(eoa % f->shared->fs_page_size));\n 887 | \n 888 | H5MF_EOA_MISALIGN(f, (eoa + size), f->shared->fs_page_size, frag_size);\n 889 | \n 890 | /* Allocate from VFD */\n 891 | if (HADDR_UNDEF == (ret_value = H5F__alloc(f, alloc_type, size + frag_size, NULL, NULL)))\n 892 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, \"can't allocate file space\");\n 893 | \n 894 | /* If there is a mis-aligned fragment at EOA */\n 895 | if (frag_size) {\n 896 | \n 897 | /* Start up the free-space manager */\n 898 | if (!(f->shared->fs_man[ptype]))\n 899 | if (H5MF__start_fstype(f, ptype) < 0)\n 900 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF,\n 901 | \"can't initialize file free space\");\n 902 | \n 903 | /* Create free space section for the fragment */\n 904 | if (NULL == (node = H5MF__sect_new(H5MF_FSPACE_SECT_LARGE, ret_value + size, frag_size)))\n 905 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF,\n 906 | \"can't initialize free space section\");\n 907 | \n 908 | /* Add the fragment to the large free-space manager */\n 909 | if (H5MF__add_sect(f, alloc_type, f->shared->fs_man[ptype], node, §ion_merged_or_shrunk) <\n 910 | 0) {\n 911 | if (section_merged_or_shrunk)\n 912 | node = NULL;\n 913 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, HADDR_UNDEF,\n 914 | \"can't re-add section to file free space\");\n 915 | }\n 916 | \n 917 | node = NULL;\n 918 | } /* end if */\n 919 | } break;\n 920 | \n 921 | case H5F_MEM_PAGE_META:\n 922 | case H5F_MEM_PAGE_DRAW:\n 923 | case H5F_MEM_PAGE_BTREE:\n 924 | case H5F_MEM_PAGE_GHEAP:\n 925 | case H5F_MEM_PAGE_LHEAP:\n 926 | case H5F_MEM_PAGE_OHDR: {\n 927 | haddr_t new_page; /* The address for the new file size page */\n 928 | \n 929 | /* Allocate one file space page */\n 930 | if (HADDR_UNDEF == (new_page = H5MF_alloc(f, alloc_type, f->shared->fs_page_size)))\n 931 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, \"can't allocate file space\");\n 932 | \n 933 | /* Start up the free-space manager */\n 934 | if (!(f->shared->fs_man[ptype]))\n 935 | if (H5MF__start_fstype(f, ptype) < 0)\n 936 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, \"can't initialize file free space\");\n 937 | assert(f->shared->fs_man[ptype]);\n 938 | \n 939 | if (NULL == (node = H5MF__sect_new(H5MF_FSPACE_SECT_SMALL, (new_page + size),\n 940 | (f->shared->fs_page_size - size))))\n 941 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, \"can't initialize free space section\");\n 942 | \n 943 | /* Add the remaining space in the page to the manager */\n 944 | if (H5MF__add_sect(f, alloc_type, f->shared->fs_man[ptype], node, §ion_merged_or_shrunk) <\n 945 | 0) {\n 946 | if (section_merged_or_shrunk)\n 947 | node = NULL;\n 948 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, HADDR_UNDEF,\n 949 | \"can't re-add section to file free space\");\n 950 | }\n 951 | \n 952 | node = NULL;\n 953 | \n 954 | /* Insert the new page into the Page Buffer list of new pages so\n 955 | we don't read an empty page from disk */\n 956 | if (f->shared->page_buf != NULL && H5PB_add_new_page(f->shared, alloc_type, new_page) < 0)\n 957 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, HADDR_UNDEF,\n 958 | \"can't add new page to Page Buffer new page list\");\n 959 | \n 960 | ret_value = new_page;\n 961 | } break;\n 962 | \n 963 | case H5F_MEM_PAGE_NTYPES:\n 964 | case H5F_MEM_PAGE_DEFAULT:\n 965 | default:\n 966 | HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF,\n 967 | \"can't allocate file space: unrecognized type\");\n 968 | break;\n 969 | } /* end switch */\n 970 | \n 971 | done:\n 972 | #ifdef H5MF_ALLOC_DEBUG\n 973 | fprintf(stderr, \"%s: Leaving: ret_value = %\" PRIuHADDR \", size = %\" PRIuHSIZE \"\\n\", __func__, ret_value,\n 974 | size);\n 975 | #endif /* H5MF_ALLOC_DEBUG */\n 976 | #ifdef H5MF_ALLOC_DEBUG_DUMP\n 977 | H5MF__sects_dump(f, stderr);\n 978 | #endif /* H5MF_ALLOC_DEBUG_DUMP */\n 979 | \n 980 | /* Release section node, if allocated and not added to section list or merged */\n 981 | if (node)\n 982 | if (H5MF__sect_free((H5FS_section_info_t *)node) < 0)\n 983 | HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, HADDR_UNDEF, \"can't free section node\");\n 984 | \n 985 | FUNC_LEAVE_NOAPI(ret_value)", "src_commits": "[{\"path\":\"/src/hdf5\",\"rev\":\"6e6273e573034090378278891a14f2cc03bb5adf\",\"url\":\"https://github.com/HDFGroup/hdf5\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"h5_extended_fuzzer\",\"h5_read_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/hdf5/src/H5MF.c\"]", "target_text": "Reach line at /src/hdf5/src/H5MF.c:885 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-hdf5:v2026-07-test1@sha256:23dac6e302371f1fa5341a1e54d537d41168b125a39a1e902464700daaae91a6", "runtime_digest": "sha256:23dac6e302371f1fa5341a1e54d537d41168b125a39a1e902464700daaae91a6", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "karchive:merged:src/qtbase/src/corelib/kernel/qobject.cpp:2306", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "karchive", "harness": "merged", "harness_binaries": "[\"k7z_fuzzer\", \"kar_fuzzer\", \"ktar_bz2_fuzzer\", \"ktar_fuzzer\", \"ktar_gz_fuzzer\", \"ktar_lz_fuzzer\", \"ktar_xz_fuzzer\", \"ktar_zst_fuzzer\", \"kzip_fuzzer\"]", "language": "c++", "file": "/src/qtbase/src/corelib/kernel/qobject.cpp", "line_start": 2306, "line_end": 2306, "line_count": 1, "function": "", "source_snippet": " 2206 | {\n 2207 | Q_ASSERT(parent);\n 2208 | Q_ASSERT(list);\n 2209 | for (QObject *obj : parent->children()) {\n 2210 | if (mo.cast(obj) && (name.isNull() || matches_objectName_non_null(obj, name)))\n 2211 | list->append(obj);\n 2212 | if (options & Qt::FindChildrenRecursively)\n 2213 | qt_qFindChildren_helper(obj, name, mo, list, options);\n 2214 | }\n 2215 | }\n 2216 | \n 2217 | #if QT_CONFIG(regularexpression)\n 2218 | /*!\n 2219 | \\internal\n 2220 | */\n 2221 | void qt_qFindChildren_helper(const QObject *parent, const QRegularExpression &re,\n 2222 | const QMetaObject &mo, QList *list, Qt::FindChildOptions options)\n 2223 | {\n 2224 | Q_ASSERT(parent);\n 2225 | Q_ASSERT(list);\n 2226 | for (QObject *obj : parent->children()) {\n 2227 | if (mo.cast(obj)) {\n 2228 | QRegularExpressionMatch m = re.match(obj->objectName());\n 2229 | if (m.hasMatch())\n 2230 | list->append(obj);\n 2231 | }\n 2232 | if (options & Qt::FindChildrenRecursively)\n 2233 | qt_qFindChildren_helper(obj, re, mo, list, options);\n 2234 | }\n 2235 | }\n 2236 | #endif // QT_CONFIG(regularexpression)\n 2237 | \n 2238 | /*!\n 2239 | \\internal\n 2240 | */\n 2241 | QObject *qt_qFindChild_helper(const QObject *parent, QAnyStringView name, const QMetaObject &mo, Qt::FindChildOptions options)\n 2242 | {\n 2243 | Q_ASSERT(parent);\n 2244 | for (QObject *obj : parent->children()) {\n 2245 | if (mo.cast(obj) && (name.isNull() || matches_objectName_non_null(obj, name)))\n 2246 | return obj;\n 2247 | }\n 2248 | if (options & Qt::FindChildrenRecursively) {\n 2249 | for (QObject *child : parent->children()) {\n 2250 | if (QObject *obj = qt_qFindChild_helper(child, name, mo, options))\n 2251 | return obj;\n 2252 | }\n 2253 | }\n 2254 | return nullptr;\n 2255 | }\n 2256 | \n 2257 | /*!\n 2258 | Makes the object a child of \\a parent.\n 2259 | \n 2260 | \\sa parent(), children()\n 2261 | */\n 2262 | void QObject::setParent(QObject *parent)\n 2263 | {\n 2264 | Q_D(QObject);\n 2265 | Q_ASSERT(!d->isWidget);\n 2266 | d->setParent_helper(parent);\n 2267 | }\n 2268 | \n 2269 | void QObjectPrivate::deleteChildren()\n 2270 | {\n 2271 | Q_ASSERT_X(!isDeletingChildren, \"QObjectPrivate::deleteChildren()\", \"isDeletingChildren already set, did this function recurse?\");\n 2272 | isDeletingChildren = true;\n 2273 | // delete children objects\n 2274 | // don't use qDeleteAll as the destructor of the child might\n 2275 | // delete siblings\n 2276 | for (int i = 0; i < children.size(); ++i) {\n 2277 | currentChildBeingDeleted = children.at(i);\n 2278 | children[i] = nullptr;\n 2279 | delete currentChildBeingDeleted;\n 2280 | }\n 2281 | children.clear();\n 2282 | currentChildBeingDeleted = nullptr;\n 2283 | isDeletingChildren = false;\n 2284 | }\n 2285 | \n 2286 | void QObjectPrivate::setParent_helper(QObject *o)\n 2287 | {\n 2288 | Q_Q(QObject);\n 2289 | Q_ASSERT_X(q != o, Q_FUNC_INFO, \"Cannot parent a QObject to itself\");\n 2290 | #ifdef QT_DEBUG\n 2291 | const auto checkForParentChildLoops = qScopeGuard([&](){\n 2292 | int depth = 0;\n 2293 | auto p = parent;\n 2294 | while (p) {\n 2295 | if (++depth == CheckForParentChildLoopsWarnDepth) {\n 2296 | qWarning(\"QObject %p (class: '%s', object name: '%s') may have a loop in its parent-child chain; \"\n 2297 | \"this is undefined behavior\",\n 2298 | q, q->metaObject()->className(), qPrintable(q->objectName()));\n 2299 | }\n 2300 | p = p->parent();\n 2301 | }\n 2302 | });\n 2303 | #endif\n 2304 | \n 2305 | if (o == parent)\n> 2306 | return;\n 2307 | \n 2308 | if (parent) {\n 2309 | QObjectPrivate *parentD = parent->d_func();\n 2310 | if (parentD->isDeletingChildren && wasDeleted\n 2311 | && parentD->currentChildBeingDeleted == q) {\n 2312 | // don't do anything since QObjectPrivate::deleteChildren() already\n 2313 | // cleared our entry in parentD->children.\n 2314 | } else {\n 2315 | const qsizetype index = parentD->children.indexOf(q);\n 2316 | if (index < 0) {\n 2317 | // we're probably recursing into setParent() from a ChildRemoved event, don't do anything\n 2318 | } else if (parentD->isDeletingChildren) {\n 2319 | parentD->children[index] = nullptr;\n 2320 | } else {\n 2321 | parentD->children.removeAt(index);\n 2322 | if (sendChildEvents && parentD->receiveChildEvents) {\n 2323 | QChildEvent e(QEvent::ChildRemoved, q);\n 2324 | QCoreApplication::sendEvent(parent, &e);\n 2325 | }\n 2326 | }\n 2327 | }\n 2328 | }\n 2329 | \n 2330 | if (receiveParentEvents) {\n 2331 | Q_ASSERT(!isWidget); // Handled in QWidget\n 2332 | QEvent e(QEvent::ParentAboutToChange);\n 2333 | QCoreApplication::sendEvent(q, &e);\n 2334 | }\n 2335 | \n 2336 | parent = o;\n 2337 | \n 2338 | if (parent) {\n 2339 | // object hierarchies are constrained to a single thread\n 2340 | if (threadData.loadRelaxed() != parent->d_func()->threadData.loadRelaxed()) {\n 2341 | qWarning(\"QObject::setParent: Cannot set parent, new parent is in a different thread\");\n 2342 | parent = nullptr;\n 2343 | return;\n 2344 | }\n 2345 | parent->d_func()->children.append(q);\n 2346 | if (sendChildEvents && parent->d_func()->receiveChildEvents) {\n 2347 | if (!isWidget) {\n 2348 | QChildEvent e(QEvent::ChildAdded, q);\n 2349 | QCoreApplication::sendEvent(parent, &e);\n 2350 | }\n 2351 | }\n 2352 | }\n 2353 | \n 2354 | if (receiveParentEvents) {\n 2355 | Q_ASSERT(!isWidget); // Handled in QWidget\n 2356 | QEvent e(QEvent::ParentChange);\n 2357 | QCoreApplication::sendEvent(q, &e);\n 2358 | }\n 2359 | }\n 2360 | \n 2361 | /*!\n 2362 | \\fn void QObject::installEventFilter(QObject *filterObj)\n 2363 | \n 2364 | Installs an event filter \\a filterObj on this object. For example:\n 2365 | \\snippet code/src_corelib_kernel_qobject.cpp 14\n 2366 | \n 2367 | An event filter is an object that receives all events that are\n 2368 | sent to this object. The filter can either stop the event or\n 2369 | forward it to this object. The event filter \\a filterObj receives\n 2370 | events via its eventFilter() function. The eventFilter() function\n 2371 | must return true if the event should be filtered, (i.e. stopped);\n 2372 | otherwise it must return false.\n 2373 | \n 2374 | If multiple event filters are installed on a single object, the\n 2375 | filter that was installed last is activated first.\n 2376 | \n 2377 | If \\a filterObj has already been installed for this object,\n 2378 | this function moves it so it acts as if it was installed last.\n 2379 | \n 2380 | Here's a \\c KeyPressEater class that eats the key presses of its\n 2381 | monitored objects:\n 2382 | \n 2383 | \\snippet code/src_corelib_kernel_qobject.cpp 15\n 2384 | \n 2385 | And here's how to install it on two widgets:\n 2386 | \n 2387 | \\snippet code/src_corelib_kernel_qobject.cpp 16\n 2388 | \n 2389 | The QShortcut class, for example, uses this technique to intercept\n 2390 | shortcut key presses.\n 2391 | \n 2392 | \\warning If you delete the receiver object in your eventFilter()\n 2393 | function, be sure to return true. If you return false, Qt sends\n 2394 | the event to the deleted object and the program will crash.\n 2395 | \n 2396 | Note that the filtering object must be in the same thread as this\n 2397 | object. If \\a filterObj is in a different thread, this function does\n 2398 | nothing. If either \\a filterObj or this object are moved to a different\n 2399 | thread after calling this function, the event filter will not be\n 2400 | called until both objects have the same thread affinity again (it\n 2401 | is \\e not removed).\n 2402 | \n 2403 | \\sa removeEventFilter(), eventFilter(), event()\n 2404 | */\n 2405 | \n 2406 | void QObject::installEventFilter(QObject *obj)", "src_commits": "[{\"path\":\"/src/extra-cmake-modules\",\"rev\":\"785cc769097051335412b1df5ef8b784112e18d1\",\"url\":\"https://invent.kde.org/frameworks/extra-cmake-modules.git\"},{\"path\":\"/src/karchive\",\"rev\":\"3557ad6e4aeb96ec1b6705f43cc3dcb96d76cd6c\",\"url\":\"https://invent.kde.org/frameworks/karchive.git\"},{\"path\":\"/src/openssl\",\"rev\":\"69e54bee8d89f6703eaeca5f4c8b6a8822161c64\",\"url\":\"https://github.com/openssl/openssl.git\"},{\"path\":\"/src/qtbase\",\"rev\":\"e40473cf5458f18d6321da0fdb82ed18465a3bd8\",\"url\":\"git://code.qt.io/qt/qtbase.git\"},{\"path\":\"/src/xz\",\"rev\":\"ebb0e6789cefe3be71756881aa8f2009fda9938c\",\"url\":\"https://github.com/tukaani-project/xz.git\"},{\"path\":\"/src/zlib\",\"rev\":\"f9dd6009be3ed32415edf1e89d1bc38380ecb95d\",\"url\":\"https://github.com/madler/zlib.git\"},{\"path\":\"/src/zstd\",\"rev\":\"0cdce55f2fbf02990df8681eedb76e32f804fcc8\",\"url\":\"https://github.com/facebook/zstd.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"karchive_fuzzer\",\"kcompressiondevice_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/qtbase/src/corelib/kernel/qobject.cpp\"]", "target_text": "Reach line at /src/qtbase/src/corelib/kernel/qobject.cpp:2306 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-karchive:v2026-07-test1@sha256:4c7ea95f50529f13a86fe490cdcd779b3d1c7e699916bda4212dc780d1082665", "runtime_digest": "sha256:4c7ea95f50529f13a86fe490cdcd779b3d1c7e699916bda4212dc780d1082665", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "karchive:merged:src/qtbase/src/corelib/thread/qmutex.h:45", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "karchive", "harness": "merged", "harness_binaries": "[\"k7z_fuzzer\", \"kar_fuzzer\", \"ktar_bz2_fuzzer\", \"ktar_fuzzer\", \"ktar_gz_fuzzer\", \"ktar_lz_fuzzer\", \"ktar_xz_fuzzer\", \"ktar_zst_fuzzer\", \"kzip_fuzzer\"]", "language": "c++", "file": "/src/qtbase/src/corelib/thread/qmutex.h", "line_start": 45, "line_end": 45, "line_count": 1, "function": "", "source_snippet": " 1 | // Copyright (C) 2016 The Qt Company Ltd.\n 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only\n 3 | // Qt-Security score:significant reason:default\n 4 | \n 5 | #ifndef QMUTEX_H\n 6 | #define QMUTEX_H\n 7 | \n 8 | #include \n 9 | #include \n 10 | #include \n 11 | #include \n 12 | \n 13 | #include \n 14 | \n 15 | QT_BEGIN_NAMESPACE\n 16 | \n 17 | #if QT_CONFIG(thread) || defined(Q_QDOC)\n 18 | \n 19 | class QMutex;\n 20 | class QRecursiveMutex;\n 21 | class QMutexPrivate;\n 22 | \n 23 | class QT6_ONLY(Q_CORE_EXPORT) QBasicMutex\n 24 | {\n 25 | Q_DISABLE_COPY_MOVE(QBasicMutex)\n 26 | protected:\n 27 | static constexpr bool FutexAlwaysAvailable =\n 28 | #if defined(Q_OS_FREEBSD) || defined(Q_OS_LINUX) || defined(Q_OS_WIN) // these platforms use futex\n 29 | true\n 30 | #else\n 31 | false\n 32 | #endif\n 33 | ;\n 34 | \n 35 | public:\n 36 | constexpr QBasicMutex()\n 37 | : d_ptr(nullptr)\n 38 | {}\n 39 | \n 40 | // BasicLockable concept\n 41 | inline void lock() noexcept(FutexAlwaysAvailable) {\n 42 | QtTsan::mutexPreLock(this, 0u);\n 43 | \n 44 | if (!fastTryLock())\n> 45 | lockInternal();\n 46 | \n 47 | QtTsan::mutexPostLock(this, 0u, 0);\n 48 | }\n 49 | \n 50 | // BasicLockable concept\n 51 | inline void unlock() noexcept {\n 52 | Q_ASSERT(d_ptr.loadRelaxed()); //mutex must be locked\n 53 | \n 54 | QtTsan::mutexPreUnlock(this, 0u);\n 55 | \n 56 | if constexpr (FutexAlwaysAvailable) {\n 57 | // we always unlock if we have futexes\n 58 | if (QMutexPrivate *d = d_ptr.fetchAndStoreRelease(nullptr); Q_UNLIKELY(d != dummyLocked()))\n 59 | unlockInternalFutex(d); // was contended\n 60 | } else {\n 61 | // if we don't have futexes, we can only unlock if not contended\n 62 | if (QMutexPrivate *d; !d_ptr.testAndSetRelease(dummyLocked(), nullptr, d))\n 63 | unlockInternal(d); // was contended\n 64 | }\n 65 | \n 66 | QtTsan::mutexPostUnlock(this, 0u);\n 67 | }\n 68 | \n 69 | bool tryLock() noexcept {\n 70 | unsigned tsanFlags = QtTsan::TryLock;\n 71 | QtTsan::mutexPreLock(this, tsanFlags);\n 72 | \n 73 | const bool success = fastTryLock();\n 74 | \n 75 | if (!success)\n 76 | tsanFlags |= QtTsan::TryLockFailed;\n 77 | QtTsan::mutexPostLock(this, tsanFlags, 0);\n 78 | \n 79 | return success;\n 80 | }\n 81 | \n 82 | // Lockable concept\n 83 | bool try_lock() noexcept { return tryLock(); }\n 84 | \n 85 | private:\n 86 | inline bool fastTryLock() noexcept\n 87 | {\n 88 | if (Q_UNLIKELY(d_ptr.loadRelaxed() != nullptr))\n 89 | return false;\n 90 | return d_ptr.testAndSetAcquire(nullptr, dummyLocked());\n 91 | }\n 92 | #if QT_CORE_REMOVED_SINCE(6, 10)\n 93 | inline bool fastTryUnlock() noexcept {\n 94 | return d_ptr.testAndSetRelease(dummyLocked(), nullptr);\n 95 | }\n 96 | #endif\n 97 | \n 98 | QT7_ONLY(Q_CORE_EXPORT)\n 99 | void lockInternal() noexcept(FutexAlwaysAvailable);\n 100 | QT7_ONLY(Q_CORE_EXPORT)\n 101 | bool lockInternal(QDeadlineTimer timeout) noexcept(FutexAlwaysAvailable);\n 102 | #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)\n 103 | bool lockInternal(int timeout) noexcept(FutexAlwaysAvailable);\n 104 | void unlockInternal() noexcept;\n 105 | #endif\n 106 | QT7_ONLY(Q_CORE_EXPORT)\n 107 | void unlockInternalFutex(void *d) noexcept;\n 108 | QT7_ONLY(Q_CORE_EXPORT)\n 109 | void unlockInternal(void *d) noexcept;\n 110 | #if QT_CORE_REMOVED_SINCE(6, 9)\n 111 | void destroyInternal(QMutexPrivate *d);\n 112 | #endif\n 113 | QT7_ONLY(Q_CORE_EXPORT)\n 114 | void destroyInternal(void *d);\n 115 | \n 116 | QBasicAtomicPointer d_ptr;\n 117 | static inline QMutexPrivate *dummyLocked() {\n 118 | return reinterpret_cast(quintptr(1));\n 119 | }\n 120 | \n 121 | friend class QMutex;\n 122 | friend class QMutexPrivate;\n 123 | };\n 124 | \n 125 | class QT6_ONLY(Q_CORE_EXPORT) QMutex : public QBasicMutex\n 126 | {\n 127 | public:\n 128 | constexpr QMutex() = default;\n 129 | ~QMutex()\n 130 | {\n 131 | QMutexPrivate *d = d_ptr.loadRelaxed();\n 132 | if (d)\n 133 | destroyInternal(d);\n 134 | }\n 135 | \n 136 | #ifdef Q_QDOC\n 137 | inline void lock() noexcept(FutexAlwaysAvailable);\n 138 | inline void unlock() noexcept;\n 139 | bool tryLock() noexcept;\n 140 | #endif\n 141 | \n 142 | // Lockable concept\n 143 | bool try_lock() noexcept { return tryLock(); }\n 144 | \n 145 | ", "src_commits": "[{\"path\":\"/src/extra-cmake-modules\",\"rev\":\"785cc769097051335412b1df5ef8b784112e18d1\",\"url\":\"https://invent.kde.org/frameworks/extra-cmake-modules.git\"},{\"path\":\"/src/karchive\",\"rev\":\"3557ad6e4aeb96ec1b6705f43cc3dcb96d76cd6c\",\"url\":\"https://invent.kde.org/frameworks/karchive.git\"},{\"path\":\"/src/openssl\",\"rev\":\"69e54bee8d89f6703eaeca5f4c8b6a8822161c64\",\"url\":\"https://github.com/openssl/openssl.git\"},{\"path\":\"/src/qtbase\",\"rev\":\"e40473cf5458f18d6321da0fdb82ed18465a3bd8\",\"url\":\"git://code.qt.io/qt/qtbase.git\"},{\"path\":\"/src/xz\",\"rev\":\"ebb0e6789cefe3be71756881aa8f2009fda9938c\",\"url\":\"https://github.com/tukaani-project/xz.git\"},{\"path\":\"/src/zlib\",\"rev\":\"f9dd6009be3ed32415edf1e89d1bc38380ecb95d\",\"url\":\"https://github.com/madler/zlib.git\"},{\"path\":\"/src/zstd\",\"rev\":\"0cdce55f2fbf02990df8681eedb76e32f804fcc8\",\"url\":\"https://github.com/facebook/zstd.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"karchive_fuzzer\",\"kcompressiondevice_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/qtbase/src/corelib/thread/qmutex.h\"]", "target_text": "Reach line at /src/qtbase/src/corelib/thread/qmutex.h:45 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-karchive:v2026-07-test1@sha256:4c7ea95f50529f13a86fe490cdcd779b3d1c7e699916bda4212dc780d1082665", "runtime_digest": "sha256:4c7ea95f50529f13a86fe490cdcd779b3d1c7e699916bda4212dc780d1082665", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "karchive:merged:src/qtbase/src/corelib/text/qlocale_unix.cpp:219", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "karchive", "harness": "merged", "harness_binaries": "[\"k7z_fuzzer\", \"kar_fuzzer\", \"ktar_bz2_fuzzer\", \"ktar_fuzzer\", \"ktar_gz_fuzzer\", \"ktar_lz_fuzzer\", \"ktar_xz_fuzzer\", \"ktar_zst_fuzzer\", \"kzip_fuzzer\"]", "language": "c++", "file": "/src/qtbase/src/corelib/text/qlocale_unix.cpp", "line_start": 219, "line_end": 219, "line_count": 1, "function": "", "source_snippet": " 119 | // if the locale is the \"C\" locale, then we can return the language we found here:\n 120 | if (lang.isEmpty() || lang == \"C\"_L1 || lang == \"POSIX\"_L1)\n 121 | return QLocale(lang);\n 122 | \n 123 | // ... otherwise, if the first part of LANGUAGE says more than or\n 124 | // contradicts what we have, use that:\n 125 | {\n 126 | QString language = qEnvironmentVariable(\"LANGUAGE\");\n 127 | // We only look at the first entry:\n 128 | if (const auto colon = language.indexOf(u':'); colon >= 0)\n 129 | language.truncate(colon); // unshared QString; this is cheap\n 130 | if (contradicts(language, lang))\n 131 | return QLocale(language);\n 132 | }\n 133 | \n 134 | return QLocale(lang);\n 135 | }\n 136 | \n 137 | QVariant QSystemLocale::query(QueryType type, QVariant &&in) const\n 138 | {\n 139 | QSystemLocaleData *d = qSystemLocaleData();\n 140 | if (!d)\n 141 | return QVariant();\n 142 | \n 143 | if (type == LocaleChanged) {\n 144 | d->readEnvironment();\n 145 | return QVariant();\n 146 | }\n 147 | \n 148 | QReadLocker locker(&d->lock);\n 149 | \n 150 | const QLocale &lc_numeric = d->lc_numeric;\n 151 | const QLocale &lc_time = d->lc_time;\n 152 | const QLocale &lc_monetary = d->lc_monetary;\n 153 | const QLocale &lc_messages = d->lc_messages;\n 154 | \n 155 | switch (type) {\n 156 | case DecimalPoint:\n 157 | return lc_numeric.decimalPoint();\n 158 | case Grouping:\n 159 | return QVariant::fromValue(lc_numeric.d->m_data->groupSizes());\n 160 | case GroupSeparator:\n 161 | return lc_numeric.groupSeparator();\n 162 | case ZeroDigit:\n 163 | return lc_numeric.zeroDigit();\n 164 | case NegativeSign:\n 165 | return lc_numeric.negativeSign();\n 166 | case DateFormatLong:\n 167 | return lc_time.dateFormat(QLocale::LongFormat);\n 168 | case DateFormatShort:\n 169 | return lc_time.dateFormat(QLocale::ShortFormat);\n 170 | case TimeFormatLong:\n 171 | return lc_time.timeFormat(QLocale::LongFormat);\n 172 | case TimeFormatShort:\n 173 | return lc_time.timeFormat(QLocale::ShortFormat);\n 174 | case DayNameLong:\n 175 | return lc_time.dayName(in.toInt(), QLocale::LongFormat);\n 176 | case DayNameShort:\n 177 | return lc_time.dayName(in.toInt(), QLocale::ShortFormat);\n 178 | case DayNameNarrow:\n 179 | return lc_time.dayName(in.toInt(), QLocale::NarrowFormat);\n 180 | case StandaloneDayNameLong:\n 181 | return lc_time.standaloneDayName(in.toInt(), QLocale::LongFormat);\n 182 | case StandaloneDayNameShort:\n 183 | return lc_time.standaloneDayName(in.toInt(), QLocale::ShortFormat);\n 184 | case StandaloneDayNameNarrow:\n 185 | return lc_time.standaloneDayName(in.toInt(), QLocale::NarrowFormat);\n 186 | case MonthNameLong:\n 187 | return lc_time.monthName(in.toInt(), QLocale::LongFormat);\n 188 | case MonthNameShort:\n 189 | return lc_time.monthName(in.toInt(), QLocale::ShortFormat);\n 190 | case MonthNameNarrow:\n 191 | return lc_time.monthName(in.toInt(), QLocale::NarrowFormat);\n 192 | case StandaloneMonthNameLong:\n 193 | return lc_time.standaloneMonthName(in.toInt(), QLocale::LongFormat);\n 194 | case StandaloneMonthNameShort:\n 195 | return lc_time.standaloneMonthName(in.toInt(), QLocale::ShortFormat);\n 196 | case StandaloneMonthNameNarrow:\n 197 | return lc_time.standaloneMonthName(in.toInt(), QLocale::NarrowFormat);\n 198 | case DateToStringLong:\n 199 | return lc_time.toString(in.toDate(), QLocale::LongFormat);\n 200 | case DateToStringShort:\n 201 | return lc_time.toString(in.toDate(), QLocale::ShortFormat);\n 202 | case TimeToStringLong:\n 203 | return lc_time.toString(in.toTime(), QLocale::LongFormat);\n 204 | case TimeToStringShort:\n 205 | return lc_time.toString(in.toTime(), QLocale::ShortFormat);\n 206 | case DateTimeFormatLong:\n 207 | return lc_time.dateTimeFormat(QLocale::LongFormat);\n 208 | case DateTimeFormatShort:\n 209 | return lc_time.dateTimeFormat(QLocale::ShortFormat);\n 210 | case DateTimeToStringLong:\n 211 | return lc_time.toString(in.toDateTime(), QLocale::LongFormat);\n 212 | case DateTimeToStringShort:\n 213 | return lc_time.toString(in.toDateTime(), QLocale::ShortFormat);\n 214 | case PositiveSign:\n 215 | return lc_numeric.positiveSign();\n 216 | case AMText:\n 217 | return lc_time.amText();\n 218 | case PMText:\n> 219 | return lc_time.pmText();\n 220 | case FirstDayOfWeek:\n 221 | return lc_time.firstDayOfWeek();\n 222 | case CurrencySymbol:\n 223 | return lc_monetary.currencySymbol(QLocale::CurrencySymbolFormat(in.toUInt()));\n 224 | case CurrencyToString: {\n 225 | switch (in.userType()) {\n 226 | case QMetaType::Int:\n 227 | return lc_monetary.toCurrencyString(in.toInt());\n 228 | case QMetaType::UInt:\n 229 | return lc_monetary.toCurrencyString(in.toUInt());\n 230 | case QMetaType::Double:\n 231 | return lc_monetary.toCurrencyString(in.toDouble());\n 232 | case QMetaType::LongLong:\n 233 | return lc_monetary.toCurrencyString(in.toLongLong());\n 234 | case QMetaType::ULongLong:\n 235 | return lc_monetary.toCurrencyString(in.toULongLong());\n 236 | default:\n 237 | break;\n 238 | }\n 239 | return QString();\n 240 | }\n 241 | case MeasurementSystem: {\n 242 | const QString meas_locale = QString::fromLatin1(d->lc_measurement_var);\n 243 | if (meas_locale.compare(\"Metric\"_L1, Qt::CaseInsensitive) == 0)\n 244 | return QLocale::MetricSystem;\n 245 | if (meas_locale.compare(\"Other\"_L1, Qt::CaseInsensitive) == 0)\n 246 | return QLocale::MetricSystem;\n 247 | return QVariant((int)QLocale(meas_locale).measurementSystem());\n 248 | }\n 249 | case Collation:\n 250 | return QString::fromLatin1(d->lc_collate_var);\n 251 | case UILanguages: {\n 252 | if (!d->uiLanguages.isEmpty())\n 253 | return d->uiLanguages;\n 254 | QString languages = QString::fromLatin1(qgetenv(\"LANGUAGE\"));\n 255 | QStringList lst;\n 256 | if (languages.isEmpty())\n 257 | lst.append(QString::fromLatin1(d->lc_messages_var));\n 258 | else\n 259 | lst = languages.split(u':');\n 260 | \n 261 | for (const QString &e : std::as_const(lst)) {\n 262 | QStringView language, script, territory;\n 263 | if (qt_splitLocaleName(e, &language, &script, &territory)) {\n 264 | QString joined = language.isEmpty() ? u\"und\"_s : language.toString();\n 265 | if (!script.isEmpty())\n 266 | joined += u'-' + script;\n 267 | if (!territory.isEmpty())\n 268 | joined += u'-' + territory;\n 269 | d->uiLanguages.append(joined);\n 270 | }\n 271 | }\n 272 | return d->uiLanguages.isEmpty() ? QVariant() : QVariant(d->uiLanguages);\n 273 | }\n 274 | case StringToStandardQuotation:\n 275 | return lc_messages.quoteString(qvariant_cast(std::move(in)));\n 276 | case StringToAlternateQuotation:\n 277 | return lc_messages.quoteString(qvariant_cast(std::move(in)),\n 278 | QLocale::AlternateQuotation);\n 279 | case ListToSeparatedString:\n 280 | return lc_messages.createSeparatedList(in.toStringList());\n 281 | case LocaleChanged:\n 282 | Q_UNREACHABLE(); // handled before the switch\n 283 | case LanguageId:\n 284 | case TerritoryId:\n 285 | case Weekdays:\n 286 | case ScriptId:\n 287 | case NativeLanguageName:\n 288 | case NativeTerritoryName:\n 289 | break;\n 290 | }\n 291 | return QVariant();\n 292 | }\n 293 | #endif // QT_NO_SYSTEMLOCALE\n 294 | \n 295 | QT_END_NAMESPACE", "src_commits": "[{\"path\":\"/src/extra-cmake-modules\",\"rev\":\"785cc769097051335412b1df5ef8b784112e18d1\",\"url\":\"https://invent.kde.org/frameworks/extra-cmake-modules.git\"},{\"path\":\"/src/karchive\",\"rev\":\"3557ad6e4aeb96ec1b6705f43cc3dcb96d76cd6c\",\"url\":\"https://invent.kde.org/frameworks/karchive.git\"},{\"path\":\"/src/openssl\",\"rev\":\"69e54bee8d89f6703eaeca5f4c8b6a8822161c64\",\"url\":\"https://github.com/openssl/openssl.git\"},{\"path\":\"/src/qtbase\",\"rev\":\"e40473cf5458f18d6321da0fdb82ed18465a3bd8\",\"url\":\"git://code.qt.io/qt/qtbase.git\"},{\"path\":\"/src/xz\",\"rev\":\"ebb0e6789cefe3be71756881aa8f2009fda9938c\",\"url\":\"https://github.com/tukaani-project/xz.git\"},{\"path\":\"/src/zlib\",\"rev\":\"f9dd6009be3ed32415edf1e89d1bc38380ecb95d\",\"url\":\"https://github.com/madler/zlib.git\"},{\"path\":\"/src/zstd\",\"rev\":\"0cdce55f2fbf02990df8681eedb76e32f804fcc8\",\"url\":\"https://github.com/facebook/zstd.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"karchive_fuzzer\",\"kcompressiondevice_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/qtbase/src/corelib/text/qlocale_unix.cpp\"]", "target_text": "Reach line at /src/qtbase/src/corelib/text/qlocale_unix.cpp:219 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-karchive:v2026-07-test1@sha256:4c7ea95f50529f13a86fe490cdcd779b3d1c7e699916bda4212dc780d1082665", "runtime_digest": "sha256:4c7ea95f50529f13a86fe490cdcd779b3d1c7e699916bda4212dc780d1082665", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "karchive:merged:src/qtbase/src/corelib/time/qtimezone.cpp:1493", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "karchive", "harness": "merged", "harness_binaries": "[\"k7z_fuzzer\", \"kar_fuzzer\", \"ktar_bz2_fuzzer\", \"ktar_fuzzer\", \"ktar_gz_fuzzer\", \"ktar_lz_fuzzer\", \"ktar_xz_fuzzer\", \"ktar_zst_fuzzer\", \"kzip_fuzzer\"]", "language": "c++", "file": "/src/qtbase/src/corelib/time/qtimezone.cpp", "line_start": 1493, "line_end": 1493, "line_count": 1, "function": "", "source_snippet": " 1393 | list.reserve(plist.size());\n 1394 | for (const QTimeZonePrivate::Data &pdata : plist)\n 1395 | list.append(QTimeZonePrivate::toOffsetData(pdata));\n 1396 | }\n 1397 | return list;\n 1398 | }\n 1399 | \n 1400 | // Static methods\n 1401 | \n 1402 | /*!\n 1403 | Returns the current system time zone IANA ID.\n 1404 | \n 1405 | Equivalent to calling systemTimeZone().id(), but may bypass some computation\n 1406 | to obtain it. Constructing a QTimeZone from the returned byte array will\n 1407 | produce the same result as systemTimeZone().\n 1408 | \n 1409 | If the backend is unable to determine the correct system zone, the result is\n 1410 | empty. In this case, systemTimeZone().isValid() is false and a warning is\n 1411 | output if either this method of systemTimeZone() is called.\n 1412 | \n 1413 | If the backend is able to determine the correct system zone but not its\n 1414 | name, an empty byte array is returned. For example, on Windows, the system\n 1415 | native ID is converted to an IANA ID - if the system ID isn't known to the\n 1416 | internal translation code, the result shall be empty. In this case,\n 1417 | systemTimeZone().isValid() shall be true.\n 1418 | \n 1419 | This method is only available when feature \\c timezone is enabled.\n 1420 | \n 1421 | \\note Prior to Qt 6.7, when the result could not be determined, the\n 1422 | misleading result \"UTC\" was returned.\n 1423 | \n 1424 | \\sa systemTimeZone()\n 1425 | */\n 1426 | \n 1427 | QByteArray QTimeZone::systemTimeZoneId()\n 1428 | {\n 1429 | QByteArray sys = global_tz->backend->systemTimeZoneId();\n 1430 | if (!sys.isEmpty())\n 1431 | return sys;\n 1432 | // The system zone, despite the empty ID, may know its real ID anyway:\n 1433 | return global_tz->backend->id();\n 1434 | }\n 1435 | \n 1436 | /*!\n 1437 | \\since 5.5\n 1438 | \n 1439 | Returns a QTimeZone object that describes local system time.\n 1440 | \n 1441 | This method is only available when feature \\c timezone is enabled. The\n 1442 | returned instance is usually equivalent to the lightweight time\n 1443 | representation \\c {QTimeZone(QTimeZone::LocalTime)}, albeit implemented as a\n 1444 | time zone.\n 1445 | \n 1446 | The returned object will not change to reflect any subsequent change to the\n 1447 | system time zone. It represents the local time that was in effect when\n 1448 | asBackendZone() was called. On misconfigured systems, such as those that\n 1449 | lack the timezone data relied on by the backend for which Qt was compiled,\n 1450 | it may be invalid. In such a case, a warning is output.\n 1451 | \n 1452 | \\sa utc(), Initialization, asBackendZone(), systemTimeZoneId()\n 1453 | */\n 1454 | QTimeZone QTimeZone::systemTimeZone()\n 1455 | {\n 1456 | // Short-cut constructor's handling of empty ID:\n 1457 | const QByteArray sysId = global_tz->backend->systemTimeZoneId();\n 1458 | const auto sys = sysId.isEmpty() ? QTimeZone(global_tz->backend) : QTimeZone(sysId);\n 1459 | if (!sys.isValid()) {\n 1460 | static bool neverWarned = true;\n 1461 | if (neverWarned) {\n 1462 | // Racey but, at worst, merely repeats the warning.\n 1463 | neverWarned = false;\n 1464 | qWarning(\"Unable to determine system time zone: \"\n 1465 | \"please check your system configuration.\");\n 1466 | }\n 1467 | }\n 1468 | return sys;\n 1469 | }\n 1470 | \n 1471 | /*!\n 1472 | \\fn QTimeZone QTimeZone::utc()\n 1473 | \\since 5.5\n 1474 | Returns a QTimeZone object that describes UTC as a time zone.\n 1475 | \n 1476 | This method is only available when feature \\c timezone is enabled. It is\n 1477 | equivalent to passing 0 to QTimeZone(int offsetSeconds) and to the\n 1478 | lightweight time representation QTimeZone(QTimeZone::UTC), albeit\n 1479 | implemented as a time zone, unlike the latter.\n 1480 | \n 1481 | \\sa systemTimeZone(), Initialization, asBackendZone()\n 1482 | */\n 1483 | QTimeZone QTimeZonePrivate::utcQTimeZone()\n 1484 | {\n 1485 | return QTimeZone(*new QUtcTimeZonePrivate());\n 1486 | }\n 1487 | \n 1488 | Q_GLOBAL_STATIC(QTimeZone, utcTimeZone, QTimeZonePrivate::utcQTimeZone());\n 1489 | \n 1490 | QTimeZone QTimeZone::utc()\n 1491 | {\n 1492 | if (Q_UNLIKELY(utcTimeZone.isDestroyed()))\n> 1493 | return QTimeZonePrivate::utcQTimeZone(); // create a new, unshared one\n 1494 | return *utcTimeZone; // take a shallow copy\n 1495 | }\n 1496 | \n 1497 | /*!\n 1498 | Returns \\c true if a given time zone \\a ianaId is available on this system.\n 1499 | \n 1500 | This may be true for some texts that are not in fact IANA IDs, notably\n 1501 | UTC-offset IDs, and known aliases for supported IANA IDs that are not listed\n 1502 | in \\l availableTimeZoneIds().\n 1503 | \n 1504 | This method is only available when feature \\c timezone is enabled.\n 1505 | \n 1506 | \\sa availableTimeZoneIds(), hasAlternativeName()\n 1507 | */\n 1508 | \n 1509 | bool QTimeZone::isTimeZoneIdAvailable(QByteArrayView ianaId)\n 1510 | {\n 1511 | #if defined(Q_OS_UNIX) && !(QT_CONFIG(timezone_tzdb) || defined(Q_OS_DARWIN) \\\n 1512 | || defined(Q_OS_ANDROID) || defined(Q_OS_VXWORKS))\n 1513 | // Keep #if-ery consistent with selection of QTzTimeZonePrivate in\n 1514 | // newBackendTimeZone(). Skip the pre-check, as the TZ backend accepts POSIX\n 1515 | // zone IDs, which need not be valid IANA IDs. See also QTBUG-112006.\n 1516 | #else\n 1517 | // isValidId is not strictly required, but faster to weed out invalid\n 1518 | // IDs as availableTimeZoneIds() may be slow\n 1519 | if (!QTimeZonePrivate::isValidId(ianaId))\n 1520 | return false;\n 1521 | #endif\n 1522 | if (QUtcTimeZonePrivate().isTimeZoneIdAvailable(ianaId)\n 1523 | || QUtcTimeZonePrivate::offsetFromUtcString(ianaId) != QTimeZonePrivate::invalidSeconds()\n 1524 | || global_tz->backend->isTimeZoneIdAvailable(ianaId)) {\n 1525 | return true;\n 1526 | }\n 1527 | if (const auto name = QTimeZonePrivate::aliasToIana(ianaId); !name.isEmpty()) {\n 1528 | return QUtcTimeZonePrivate().isTimeZoneIdAvailable(name)\n 1529 | || global_tz->backend->isTimeZoneIdAvailable(name);\n 1530 | }\n 1531 | \n 1532 | QByteArrayView known = global_tz->backend->availableAlias(ianaId);\n 1533 | return !known.isEmpty();\n 1534 | }\n 1535 | \n 1536 | [[maybe_unused]] static bool isUniqueSorted(const QList &seq)\n 1537 | {\n 1538 | // Since [..., b, a, ...] isn't unique-sorted if a <= b, at least the\n 1539 | // suggested implementations of is_sorted() and is_sorted_until() imply a\n 1540 | // non-unique sorted list will fail is_sorted() with <= comparison.\n 1541 | return std::is_sorted(seq.begin(), seq.end(), std::less_equal());\n 1542 | }\n 1543 | \n 1544 | static QList set_union(const QList &l1, const QList &l2)\n 1545 | {\n 1546 | Q_ASSERT(isUniqueSorted(l1));\n 1547 | Q_ASSERT(isUniqueSorted(l2));\n 1548 | QList result;\n 1549 | result.reserve(l1.size() + l2.size());\n 1550 | std::set_union(l1.begin(), l1.end(),\n 1551 | l2.begin(), l2.end(),\n 1552 | std::back_inserter(result));\n 1553 | return result;\n 1554 | }\n 1555 | \n 1556 | /*!\n 1557 | Returns a list of available time zone IDs on this system.\n 1558 | \n 1559 | This includes an IANA ID for each zone supported by the system timezone\n 1560 | information source, plus some aliases of these and a limited set of\n 1561 | commonly-used UTC-offset IDs.\n 1562 | \n 1563 | The QTimeZone constructor will also accept some UTC-offset IDs that are not\n 1564 | in the list returned - it would be impractical to list all possible\n 1565 | UTC-offset IDs. It also accepts known aliases for supported IANA IDs, some\n 1566 | of which may not appear in this list. Such IDs are also accepted by\n 1567 | isTimeZoneIdAvailable().\n 1568 | \n 1569 | Where the Unicode Consortium's Common Locale Data Repository (CLDR) regards\n 1570 | a supported IANA ID as an alias for its stable name for the zone, this\n 1571 | stable name for the zone is also included in the list (even though it may be\n 1572 | out of date), both for stability and as cross-platform common ground where\n 1573 | different system timezone information sources use different aliases for the\n 1574 | same zone.\n 1575 | \n 1576 | This method is only available when feature \\c timezone is enabled.\n 1577 | \n 1578 | \\sa isTimeZoneIdAvailable(), hasAlternativeName()\n 1579 | */\n 1580 | \n 1581 | QList QTimeZone::availableTimeZoneIds()\n 1582 | {\n 1583 | // Backends MUST implement availableTimeZoneIds().\n 1584 | // The return from each backend MUST be sorted and unique.\n 1585 | return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(),\n 1586 | global_tz->backend->availableTimeZoneIds());\n 1587 | }\n 1588 | \n 1589 | /*!\n 1590 | Returns a list of all available IANA time zone IDs for a given \\a territory.\n 1591 | \n 1592 | As a special case, a \\a territory of \\l {QLocale::} {AnyTerritory} selects\n 1593 | those time zones that have a non-territorial association, such as UTC, while", "src_commits": "[{\"path\":\"/src/extra-cmake-modules\",\"rev\":\"785cc769097051335412b1df5ef8b784112e18d1\",\"url\":\"https://invent.kde.org/frameworks/extra-cmake-modules.git\"},{\"path\":\"/src/karchive\",\"rev\":\"3557ad6e4aeb96ec1b6705f43cc3dcb96d76cd6c\",\"url\":\"https://invent.kde.org/frameworks/karchive.git\"},{\"path\":\"/src/openssl\",\"rev\":\"69e54bee8d89f6703eaeca5f4c8b6a8822161c64\",\"url\":\"https://github.com/openssl/openssl.git\"},{\"path\":\"/src/qtbase\",\"rev\":\"e40473cf5458f18d6321da0fdb82ed18465a3bd8\",\"url\":\"git://code.qt.io/qt/qtbase.git\"},{\"path\":\"/src/xz\",\"rev\":\"ebb0e6789cefe3be71756881aa8f2009fda9938c\",\"url\":\"https://github.com/tukaani-project/xz.git\"},{\"path\":\"/src/zlib\",\"rev\":\"f9dd6009be3ed32415edf1e89d1bc38380ecb95d\",\"url\":\"https://github.com/madler/zlib.git\"},{\"path\":\"/src/zstd\",\"rev\":\"0cdce55f2fbf02990df8681eedb76e32f804fcc8\",\"url\":\"https://github.com/facebook/zstd.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"karchive_fuzzer\",\"kcompressiondevice_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/qtbase/src/corelib/time/qtimezone.cpp\"]", "target_text": "Reach line at /src/qtbase/src/corelib/time/qtimezone.cpp:1493 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-karchive:v2026-07-test1@sha256:4c7ea95f50529f13a86fe490cdcd779b3d1c7e699916bda4212dc780d1082665", "runtime_digest": "sha256:4c7ea95f50529f13a86fe490cdcd779b3d1c7e699916bda4212dc780d1082665", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "karchive:merged:src/qtbase/src/corelib/time/qdatetime.cpp:2976", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "karchive", "harness": "merged", "harness_binaries": "[\"k7z_fuzzer\", \"kar_fuzzer\", \"ktar_bz2_fuzzer\", \"ktar_fuzzer\", \"ktar_gz_fuzzer\", \"ktar_lz_fuzzer\", \"ktar_xz_fuzzer\", \"ktar_zst_fuzzer\", \"kzip_fuzzer\"]", "language": "c++", "file": "/src/qtbase/src/corelib/time/qdatetime.cpp", "line_start": 2976, "line_end": 2976, "line_count": 1, "function": "", "source_snippet": " 2876 | // Do the conversion in a year with the same days of the week, so DST\n 2877 | // dates might be right, and adjust by the number of days that was off:\n 2878 | const qint64 jd = msecsToJulianDay(utcMSecs);\n 2879 | const auto ymd = QGregorianCalendar::partsFromJulian(jd);\n 2880 | qint64 diffMillis, fakeUtc;\n 2881 | const auto fakeJd = QGregorianCalendar::julianFromParts(systemTimeYearMatching(ymd.year),\n 2882 | ymd.month, ymd.day);\n 2883 | if (Q_UNLIKELY(!fakeJd\n 2884 | || qMulOverflow(jd - *fakeJd, std::integral_constant(),\n 2885 | &diffMillis)\n 2886 | || qSubOverflow(utcMSecs, diffMillis, &fakeUtc))) {\n 2887 | return result;\n 2888 | }\n 2889 | \n 2890 | result = QLocalTime::utcToLocal(fakeUtc);\n 2891 | // Now correct result.when for the use of the fake date:\n 2892 | if (!result.valid || qAddOverflow(result.when, diffMillis, &result.when)) {\n 2893 | // If utcToLocal() failed, its return has the fake when; restore utcMSecs.\n 2894 | // Fail on overflow, but preserve offset and DST-ness.\n 2895 | result.when = utcMSecs;\n 2896 | result.valid = false;\n 2897 | }\n 2898 | return result;\n 2899 | }\n 2900 | \n 2901 | static auto millisToWithinRange(qint64 millis)\n 2902 | {\n 2903 | struct R {\n 2904 | qint64 shifted = 0;\n 2905 | bool good = false;\n 2906 | } result;\n 2907 | qint64 jd = msecsToJulianDay(millis);\n 2908 | auto ymd = QGregorianCalendar::partsFromJulian(jd);\n 2909 | const auto fakeJd = QGregorianCalendar::julianFromParts(systemTimeYearMatching(ymd.year),\n 2910 | ymd.month, ymd.day);\n 2911 | result.good = fakeJd && !daysAndMillisOverflow(*fakeJd - jd, millis, &result.shifted);\n 2912 | return result;\n 2913 | }\n 2914 | \n 2915 | /*!\n 2916 | \\internal\n 2917 | \\enum QDateTimePrivate::TransitionOption\n 2918 | \n 2919 | This enumeration is used to resolve datetime combinations which fall in \\l\n 2920 | {Timezone transitions}. The transition is described as a \"gap\" if there are\n 2921 | time representations skipped over by the zone, as is common in the \"spring\n 2922 | forward\" transitions in many zones on entering daylight-saving time. The\n 2923 | transition is described as a \"fold\" if there are time representations\n 2924 | repeated in the zone, as in a \"fall back\" transition out of daylight-saving\n 2925 | time.\n 2926 | \n 2927 | When the options specified do not determine a resolution for a datetime, it\n 2928 | is marked invalid.\n 2929 | \n 2930 | The prepared option sets above are in fact composed from low-level atomic\n 2931 | options. For each of gap and fold you can chose between two candidate times,\n 2932 | one before or after the transition, based on the time requested; or you can\n 2933 | pick the moment of transition, or the start or end of the transition\n 2934 | interval. For a gap, the start and end of the interval are the moment of the\n 2935 | transition, but for a repeated interval the start of the first pass is the\n 2936 | start of the transition interval, the end of the second pass is the end of\n 2937 | the transition interval and the moment of the transition itself is both the\n 2938 | end of the first pass and the start of the second.\n 2939 | \n 2940 | \\value GapUseBefore For a time in a gap, use a time before the transition,\n 2941 | as if stepping back from a later time.\n 2942 | \\value GapUseAfter For a time in a gap, use a time after the transition, as\n 2943 | if stepping forward from an earlier time.\n 2944 | \\value FoldUseBefore For a repeated time, use the first candidate, which is\n 2945 | before the transition.\n 2946 | \\value FoldUseAfter For a repeated time, use the second candidate, which is\n 2947 | after the transition.\n 2948 | \\value FlipForReverseDst For \"reversed\" DST, this reverses the preceding\n 2949 | four options (see below).\n 2950 | \n 2951 | The last has no effect unless the \"daylight-saving\" time side of the\n 2952 | transition is known to have a lower offset from UTC than the standard time\n 2953 | side. (This is the \"reversed\" DST case of \\l {Timezone transitions}.) In\n 2954 | that case, if other options would select a time after the transition, a time\n 2955 | before is used instead, and vice versa. This effectively turns a preference\n 2956 | for the side with lower offset into a preference for the side that is\n 2957 | officially standard time, even if it has higher offset; and conversely a\n 2958 | preference for higher offset into a preference for daylight-saving time,\n 2959 | even if it has a lower offset. This option has no effect on a resolution\n 2960 | that selects the moment of transition or the start or end of the transition\n 2961 | interval.\n 2962 | \n 2963 | The result of combining more than one of the \\c GapUse* options is\n 2964 | undefined; likewise for the \\c FoldUse*. Each of QDateTime's\n 2965 | TransitionResolution values, aside from Reject, maps to a combination that\n 2966 | incorporates one from each of these sets.\n 2967 | */\n 2968 | \n 2969 | constexpr static QDateTimePrivate::TransitionOptions\n 2970 | toTransitionOptions(QDateTime::TransitionResolution res)\n 2971 | {\n 2972 | switch (res) {\n 2973 | case QDateTime::TransitionResolution::RelativeToBefore:\n 2974 | return QDateTimePrivate::GapUseAfter | QDateTimePrivate::FoldUseBefore;\n 2975 | case QDateTime::TransitionResolution::RelativeToAfter:\n> 2976 | return QDateTimePrivate::GapUseBefore | QDateTimePrivate::FoldUseAfter;\n 2977 | case QDateTime::TransitionResolution::PreferBefore:\n 2978 | return QDateTimePrivate::GapUseBefore | QDateTimePrivate::FoldUseBefore;\n 2979 | case QDateTime::TransitionResolution::PreferAfter:\n 2980 | return QDateTimePrivate::GapUseAfter | QDateTimePrivate::FoldUseAfter;\n 2981 | case QDateTime::TransitionResolution::PreferStandard:\n 2982 | return QDateTimePrivate::GapUseBefore\n 2983 | | QDateTimePrivate::FoldUseAfter\n 2984 | | QDateTimePrivate::FlipForReverseDst;\n 2985 | case QDateTime::TransitionResolution::PreferDaylightSaving:\n 2986 | return QDateTimePrivate::GapUseAfter\n 2987 | | QDateTimePrivate::FoldUseBefore\n 2988 | | QDateTimePrivate::FlipForReverseDst;\n 2989 | case QDateTime::TransitionResolution::Reject: break;\n 2990 | }\n 2991 | return {};\n 2992 | }\n 2993 | \n 2994 | constexpr static QDateTimePrivate::TransitionOptions\n 2995 | toTransitionOptions(QDateTimePrivate::DaylightStatus dst)\n 2996 | {\n 2997 | return toTransitionOptions(dst == QDateTimePrivate::DaylightTime\n 2998 | ? QDateTime::TransitionResolution::PreferDaylightSaving\n 2999 | : QDateTime::TransitionResolution::PreferStandard);\n 3000 | }\n 3001 | \n 3002 | QString QDateTimePrivate::localNameAtMillis(qint64 millis, DaylightStatus dst)\n 3003 | {\n 3004 | const QDateTimePrivate::TransitionOptions resolve = toTransitionOptions(dst);\n 3005 | QString abbreviation;\n 3006 | if (millisInSystemRange(millis, MSECS_PER_DAY)) {\n 3007 | abbreviation = QLocalTime::localTimeAbbbreviationAt(millis, resolve);\n 3008 | if (!abbreviation.isEmpty())\n 3009 | return abbreviation;\n 3010 | }\n 3011 | \n 3012 | // Otherwise, outside the system range.\n 3013 | #if QT_CONFIG(timezone)\n 3014 | // Use the system zone:\n 3015 | const auto sys = QTimeZone::systemTimeZone();\n 3016 | if (sys.isValid()) {\n 3017 | ZoneState state = zoneStateAtMillis(sys, millis, resolve);\n 3018 | if (state.valid)\n 3019 | return sys.d->abbreviation(state.when - state.offset * MSECS_PER_SEC);\n 3020 | }\n 3021 | #endif // timezone\n 3022 | \n 3023 | // Kludge\n 3024 | // Use a time in the system range with the same day-of-week pattern to its year:\n 3025 | auto fake = millisToWithinRange(millis);\n 3026 | if (Q_LIKELY(fake.good))\n 3027 | return QLocalTime::localTimeAbbbreviationAt(fake.shifted, resolve);\n 3028 | \n 3029 | // Overflow, apparently.\n 3030 | return {};\n 3031 | }\n 3032 | \n 3033 | // Determine the offset from UTC at the given local time as millis.\n 3034 | QDateTimePrivate::ZoneState QDateTimePrivate::localStateAtMillis(\n 3035 | qint64 millis, QDateTimePrivate::TransitionOptions resolve)\n 3036 | {\n 3037 | // First, if millis is within a day of the viable range, try mktime() in\n 3038 | // case it does fall in the range and gets useful information:\n 3039 | if (millisInSystemRange(millis, MSECS_PER_DAY)) {\n 3040 | auto result = QLocalTime::mapLocalTime(millis, resolve);\n 3041 | if (result.valid)\n 3042 | return result;\n 3043 | }\n 3044 | \n 3045 | // Otherwise, outside the system range.\n 3046 | #if QT_CONFIG(timezone)\n 3047 | // Use the system zone:\n 3048 | const auto sys = QTimeZone::systemTimeZone();\n 3049 | if (sys.isValid())\n 3050 | return zoneStateAtMillis(sys, millis, resolve);\n 3051 | #endif // timezone\n 3052 | \n 3053 | // Kludge\n 3054 | // Use a time in the system range with the same day-of-week pattern to its year:\n 3055 | auto fake = millisToWithinRange(millis);\n 3056 | if (Q_LIKELY(fake.good)) {\n 3057 | auto result = QLocalTime::mapLocalTime(fake.shifted, resolve);\n 3058 | if (result.valid) {\n 3059 | qint64 adjusted;\n 3060 | if (Q_UNLIKELY(qAddOverflow(result.when, millis - fake.shifted, &adjusted))) {\n 3061 | using Bound = std::numeric_limits;\n 3062 | adjusted = millis < fake.shifted ? Bound::min() : Bound::max();\n 3063 | }\n 3064 | result.when = adjusted;\n 3065 | } else {\n 3066 | result.when = millis;\n 3067 | }\n 3068 | return result;\n 3069 | }\n 3070 | // Overflow, apparently.\n 3071 | return {millis};\n 3072 | }\n 3073 | \n 3074 | #if QT_CONFIG(timezone)\n 3075 | // For a TimeZone and a time expressed in zone msecs encoding, compute the\n 3076 | // actual DST-ness and offset, adjusting the time if needed to escape a", "src_commits": "[{\"path\":\"/src/extra-cmake-modules\",\"rev\":\"785cc769097051335412b1df5ef8b784112e18d1\",\"url\":\"https://invent.kde.org/frameworks/extra-cmake-modules.git\"},{\"path\":\"/src/karchive\",\"rev\":\"3557ad6e4aeb96ec1b6705f43cc3dcb96d76cd6c\",\"url\":\"https://invent.kde.org/frameworks/karchive.git\"},{\"path\":\"/src/openssl\",\"rev\":\"69e54bee8d89f6703eaeca5f4c8b6a8822161c64\",\"url\":\"https://github.com/openssl/openssl.git\"},{\"path\":\"/src/qtbase\",\"rev\":\"e40473cf5458f18d6321da0fdb82ed18465a3bd8\",\"url\":\"git://code.qt.io/qt/qtbase.git\"},{\"path\":\"/src/xz\",\"rev\":\"ebb0e6789cefe3be71756881aa8f2009fda9938c\",\"url\":\"https://github.com/tukaani-project/xz.git\"},{\"path\":\"/src/zlib\",\"rev\":\"f9dd6009be3ed32415edf1e89d1bc38380ecb95d\",\"url\":\"https://github.com/madler/zlib.git\"},{\"path\":\"/src/zstd\",\"rev\":\"0cdce55f2fbf02990df8681eedb76e32f804fcc8\",\"url\":\"https://github.com/facebook/zstd.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"karchive_fuzzer\",\"kcompressiondevice_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/qtbase/src/corelib/time/qdatetime.cpp\"]", "target_text": "Reach line at /src/qtbase/src/corelib/time/qdatetime.cpp:2976 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-karchive:v2026-07-test1@sha256:4c7ea95f50529f13a86fe490cdcd779b3d1c7e699916bda4212dc780d1082665", "runtime_digest": "sha256:4c7ea95f50529f13a86fe490cdcd779b3d1c7e699916bda4212dc780d1082665", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "liboqs:merged:src/liboqs/src/sig/mqom/mqom_mqom_common/xof.h:272", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "liboqs", "harness": "merged", "harness_binaries": "[\"fuzz_test_kem\", \"fuzz_test_sig\", \"fuzz_test_sig_stfl_lms\", \"fuzz_test_sig_stfl_xmss\"]", "language": "c", "file": "/src/liboqs/src/sig/mqom/mqom_mqom_common/xof.h", "line_start": 272, "line_end": 272, "line_count": 1, "function": "", "source_snippet": " 172 | \tuint64_t magic;\n 173 | \tOQS_SHA3_shake128_inc_ctx ctx;\n 174 | } Keccak_HashInstance;\n 175 | #define XOF_CTX_X4_INIT_MAGIC 0xf11dbabebadf999dULL\n 176 | typedef struct {\n 177 | \tuint64_t magic;\n 178 | \tOQS_SHA3_shake128_x4_inc_ctx ctx;\n 179 | } Keccak_HashInstancetimes4;\n 180 | #define __XOF_Init OQS_SHA3_shake128_inc_init\n 181 | #define __XOF_Update OQS_SHA3_shake128_inc_absorb\n 182 | #define __XOF_Final OQS_SHA3_shake128_inc_finalize\n 183 | #define __XOF_Squeeze OQS_SHA3_shake128_inc_squeeze\n 184 | #define __XOF_Release OQS_SHA3_shake128_inc_ctx_release\n 185 | #define __XOF_Reset OQS_SHA3_shake128_inc_ctx_reset\n 186 | #define __XOF_Init_x4 OQS_SHA3_shake128_x4_inc_init\n 187 | #define __XOF_Update_x4 OQS_SHA3_shake128_x4_inc_absorb\n 188 | #define __XOF_Final_x4 OQS_SHA3_shake128_x4_inc_finalize\n 189 | #define __XOF_Squeeze_x4 OQS_SHA3_shake128_x4_inc_squeeze\n 190 | #define __XOF_Release_x4 OQS_SHA3_shake128_x4_inc_ctx_release\n 191 | #define __XOF_Reset_x4 OQS_SHA3_shake128_x4_inc_ctx_reset\n 192 | /* === 192 bits security === */\n 193 | #elif MQOM2_PARAM_SECURITY == 192\n 194 | #define XOF_CTX_INIT_MAGIC 0xf00dbabebadfeeedULL\n 195 | typedef struct {\n 196 | \tuint64_t magic;\n 197 | \tOQS_SHA3_shake256_inc_ctx ctx;\n 198 | } Keccak_HashInstance;\n 199 | #define XOF_CTX_X4_INIT_MAGIC 0xf11dbabebadf999dULL\n 200 | typedef struct {\n 201 | \tuint64_t magic;\n 202 | \tOQS_SHA3_shake256_x4_inc_ctx ctx;\n 203 | } Keccak_HashInstancetimes4;\n 204 | #define __XOF_Init OQS_SHA3_shake256_inc_init\n 205 | #define __XOF_Update OQS_SHA3_shake256_inc_absorb\n 206 | #define __XOF_Final OQS_SHA3_shake256_inc_finalize\n 207 | #define __XOF_Squeeze OQS_SHA3_shake256_inc_squeeze\n 208 | #define __XOF_Release OQS_SHA3_shake256_inc_ctx_release\n 209 | #define __XOF_Reset OQS_SHA3_shake256_inc_ctx_reset\n 210 | #define __XOF_Init_x4 OQS_SHA3_shake256_x4_inc_init\n 211 | #define __XOF_Update_x4 OQS_SHA3_shake256_x4_inc_absorb\n 212 | #define __XOF_Final_x4 OQS_SHA3_shake256_x4_inc_finalize\n 213 | #define __XOF_Squeeze_x4 OQS_SHA3_shake256_x4_inc_squeeze\n 214 | #define __XOF_Release_x4 OQS_SHA3_shake256_x4_inc_ctx_release\n 215 | #define __XOF_Reset_x4 OQS_SHA3_shake256_x4_inc_ctx_reset\n 216 | /* === 256 bits security === */\n 217 | #elif MQOM2_PARAM_SECURITY == 256\n 218 | #define XOF_CTX_INIT_MAGIC 0xf00dbabebadfeeedULL\n 219 | typedef struct {\n 220 | \tuint64_t magic;\n 221 | \tOQS_SHA3_shake256_inc_ctx ctx;\n 222 | } Keccak_HashInstance;\n 223 | #define XOF_CTX_X4_INIT_MAGIC 0xf11dbabebadf999dULL\n 224 | typedef struct {\n 225 | \tuint64_t magic;\n 226 | \tOQS_SHA3_shake256_x4_inc_ctx ctx;\n 227 | } Keccak_HashInstancetimes4;\n 228 | #define __XOF_Init OQS_SHA3_shake256_inc_init\n 229 | #define __XOF_Update OQS_SHA3_shake256_inc_absorb\n 230 | #define __XOF_Final OQS_SHA3_shake256_inc_finalize\n 231 | #define __XOF_Squeeze OQS_SHA3_shake256_inc_squeeze\n 232 | #define __XOF_Release OQS_SHA3_shake256_inc_ctx_release\n 233 | #define __XOF_Reset OQS_SHA3_shake256_inc_ctx_reset\n 234 | #define __XOF_Init_x4 OQS_SHA3_shake256_x4_inc_init\n 235 | #define __XOF_Update_x4 OQS_SHA3_shake256_x4_inc_absorb\n 236 | #define __XOF_Final_x4 OQS_SHA3_shake256_x4_inc_finalize\n 237 | #define __XOF_Squeeze_x4 OQS_SHA3_shake256_x4_inc_squeeze\n 238 | #define __XOF_Release_x4 OQS_SHA3_shake256_x4_inc_ctx_release\n 239 | #define __XOF_Reset_x4 OQS_SHA3_shake256_x4_inc_ctx_reset\n 240 | #else\n 241 | #error \"No XOF implementation for this security level\"\n 242 | #endif\n 243 | \n 244 | /**/\n 245 | static inline int _XOF_Init(Keccak_HashInstance *ctx) {\n 246 | \tif (ctx == NULL) {\n 247 | \t\treturn -1;\n 248 | \t}\n 249 | \tif (ctx->magic == XOF_CTX_INIT_MAGIC) {\n 250 | \t\t__XOF_Reset(&(ctx->ctx));\n 251 | \t} else {\n 252 | \t\t__XOF_Init(&(ctx->ctx));\n 253 | \t\tctx->magic = XOF_CTX_INIT_MAGIC;\n 254 | \t}\n 255 | \treturn 0;\n 256 | }\n 257 | static inline int _XOF_Init_x4(Keccak_HashInstancetimes4 *ctx) {\n 258 | \tif (ctx == NULL) {\n 259 | \t\treturn -1;\n 260 | \t}\n 261 | \tif (ctx->magic == XOF_CTX_X4_INIT_MAGIC) {\n 262 | \t\t__XOF_Reset_x4(&(ctx->ctx));\n 263 | \t} else {\n 264 | \t\t__XOF_Init_x4(&(ctx->ctx));\n 265 | \t\tctx->magic = XOF_CTX_X4_INIT_MAGIC;\n 266 | \t}\n 267 | \treturn 0;\n 268 | }\n 269 | /**/\n 270 | static inline int _XOF_Update(Keccak_HashInstance *ctx, const uint8_t* data, size_t byte_len) {\n 271 | \tif ((ctx == NULL) || (ctx->magic != XOF_CTX_INIT_MAGIC)) {\n> 272 | \t\treturn -1;\n 273 | \t}\n 274 | \t__XOF_Update(&(ctx->ctx), data, byte_len >> 3);\n 275 | \treturn 0;\n 276 | }\n 277 | static inline int _XOF_Update_x4(Keccak_HashInstancetimes4 *ctx, const uint8_t *data[4], size_t byte_len) {\n 278 | \tif ((ctx == NULL) || (ctx->magic != XOF_CTX_X4_INIT_MAGIC)) {\n 279 | \t\treturn -1;\n 280 | \t}\n 281 | \t__XOF_Update_x4(&(ctx->ctx), data[0], data[1], data[2], data[3], byte_len >> 3);\n 282 | \treturn 0;\n 283 | }\n 284 | /**/\n 285 | static inline int _XOF_Squeeze(Keccak_HashInstance *ctx, uint8_t* data, size_t byte_len) {\n 286 | \tif ((ctx == NULL) || (ctx->magic != XOF_CTX_INIT_MAGIC)) {\n 287 | \t\treturn -1;\n 288 | \t}\n 289 | \t__XOF_Squeeze(data, byte_len >> 3, &(ctx->ctx));\n 290 | \treturn 0;\n 291 | }\n 292 | static inline int _XOF_Squeeze_x4(Keccak_HashInstancetimes4 *ctx, uint8_t *data[4], size_t byte_len) {\n 293 | \tif ((ctx == NULL) || (ctx->magic != XOF_CTX_X4_INIT_MAGIC)) {\n 294 | \t\treturn -1;\n 295 | \t}\n 296 | \t__XOF_Squeeze_x4(data[0], data[1], data[2], data[3], byte_len >> 3, &(ctx->ctx));\n 297 | \treturn 0;\n 298 | }\n 299 | /**/\n 300 | static inline int _XOF_Final(Keccak_HashInstance *ctx, const uint8_t* dummy) {\n 301 | \t(void)dummy;\n 302 | \tif ((ctx == NULL) || (ctx->magic != XOF_CTX_INIT_MAGIC)) {\n 303 | \t\treturn -1;\n 304 | \t}\n 305 | \t__XOF_Final(&(ctx->ctx));\n 306 | \treturn 0;\n 307 | }\n 308 | static inline int _XOF_Final_x4(Keccak_HashInstancetimes4 *ctx, const uint8_t* dummy) {\n 309 | \t(void)dummy;\n 310 | \tif ((ctx == NULL) || (ctx->magic != XOF_CTX_X4_INIT_MAGIC)) {\n 311 | \t\treturn -1;\n 312 | \t}\n 313 | \t__XOF_Final_x4(&(ctx->ctx));\n 314 | \treturn 0;\n 315 | }\n 316 | \n 317 | static inline void _XOF_Release(Keccak_HashInstance *ctx) {\n 318 | \tif ((ctx != NULL) && (ctx->magic == XOF_CTX_INIT_MAGIC)) {\n 319 | \t\t__XOF_Release(&(ctx->ctx));\n 320 | \t}\n 321 | \tif(ctx != NULL){\n 322 | \t\tctx->magic = 0;\n 323 | \t}\n 324 | \treturn;\n 325 | }\n 326 | static inline void _XOF_Release_x4(Keccak_HashInstancetimes4 *ctx) {\n 327 | \tif ((ctx != NULL) && (ctx->magic == XOF_CTX_X4_INIT_MAGIC)) {\n 328 | \t\t__XOF_Release_x4(&(ctx->ctx));\n 329 | \t}\n 330 | \tif(ctx != NULL){\n 331 | \t\tctx->magic = 0;\n 332 | \t}\n 333 | \treturn;\n 334 | }\n 335 | \n 336 | #endif\n 337 | \n 338 | /* Deal with namespacing */\n 339 | #define xof_init MQOM_NAMESPACE(xof_init)\n 340 | #define xof_update MQOM_NAMESPACE(xof_update)\n 341 | #define xof_squeeze MQOM_NAMESPACE(xof_squeeze)\n 342 | #define xof_clean_ctx MQOM_NAMESPACE(xof_clean_ctx)\n 343 | #define xof_init_x4 MQOM_NAMESPACE(xof_init_x4)\n 344 | #define xof_update_x4 MQOM_NAMESPACE(xof_update_x4)\n 345 | #define xof_squeeze_x4 MQOM_NAMESPACE(xof_squeeze_x4)\n 346 | #define xof_clean_ctx_x4 MQOM_NAMESPACE(xof_clean_ctx_x4)\n 347 | \n 348 | /* Hash and XOF contexts are simply Keccak instances, with XOF finalization state\n 349 | * for XOF\n 350 | */\n 351 | typedef struct {\n 352 | \tuint8_t xof_finalized;\n 353 | \tKeccak_HashInstance ctx;\n 354 | } xof_context;\n 355 | \n 356 | /* x4 (4 times) context */\n 357 | typedef struct {\n 358 | \tuint8_t xof_finalized;\n 359 | \tKeccak_HashInstancetimes4 ctx;\n 360 | } xof_context_x4;\n 361 | \n 362 | /* Exported API for XOF, simple and x4 */\n 363 | int xof_init(xof_context *ctx);\n 364 | int xof_update(xof_context *ctx, const uint8_t *data, size_t byte_len);\n 365 | int xof_squeeze(xof_context *ctx, uint8_t *out, uint32_t byte_len);\n 366 | void xof_clean_ctx(xof_context *ctx);\n 367 | \n 368 | int xof_init_x4(xof_context_x4 *ctx);\n 369 | int xof_update_x4(xof_context_x4 *ctx, const uint8_t *data[4], size_t byte_len);\n 370 | int xof_squeeze_x4(xof_context_x4 *ctx, uint8_t *out[4], uint32_t byte_len);\n 371 | void xof_clean_ctx_x4(xof_context_x4 *ctx);\n 372 | ", "src_commits": "[{\"path\":\"/src/liboqs\",\"rev\":\"0e325ccc2d96d37e7433ff8938550d8111b3931c\",\"url\":\"https://github.com/open-quantum-safe/liboqs.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_test_kem\",\"fuzz_test_sig\",\"fuzz_test_sig_stfl_lms\",\"fuzz_test_sig_stfl_xmss\"]", "cnt": 0, "coverage_keys": "[\"/src/liboqs/src/sig/mqom/mqom_mqom_common/xof.h\"]", "target_text": "Reach line at /src/liboqs/src/sig/mqom/mqom_mqom_common/xof.h:272 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-liboqs:v2026-07-test1@sha256:b00578ef6bc10a015619ddcf614cb217e8a1ecae49b3da9eba084a3db59e604a", "runtime_digest": "sha256:b00578ef6bc10a015619ddcf614cb217e8a1ecae49b3da9eba084a3db59e604a", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "liboqs:merged:src/liboqs/src/sig/uov/sig_uov_ov_V_pkc.c:95", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "liboqs", "harness": "merged", "harness_binaries": "[\"fuzz_test_kem\", \"fuzz_test_sig\", \"fuzz_test_sig_stfl_lms\", \"fuzz_test_sig_stfl_xmss\"]", "language": "c", "file": "/src/liboqs/src/sig/uov/sig_uov_ov_V_pkc.c", "line_start": 95, "line_end": 95, "line_count": 1, "function": "", "source_snippet": " 1 | // SPDX-License-Identifier: MIT\n 2 | \n 3 | #include \n 4 | \n 5 | #include \n 6 | \n 7 | #if defined(OQS_ENABLE_SIG_uov_ov_V_pkc)\n 8 | OQS_SIG *OQS_SIG_uov_ov_V_pkc_new(void) {\n 9 | \n 10 | \tOQS_SIG *sig = OQS_MEM_malloc(sizeof(OQS_SIG));\n 11 | \tif (sig == NULL) {\n 12 | \t\treturn NULL;\n 13 | \t}\n 14 | \tsig->method_name = OQS_SIG_alg_uov_ov_V_pkc;\n 15 | \tsig->alg_version = \"Round 2\";\n 16 | \n 17 | \tsig->claimed_nist_level = 5;\n 18 | \tsig->euf_cma = true;\n 19 | \tsig->suf_cma = false;\n 20 | \tsig->sig_with_ctx_support = false;\n 21 | \n 22 | \tsig->length_public_key = OQS_SIG_uov_ov_V_pkc_length_public_key;\n 23 | \tsig->length_secret_key = OQS_SIG_uov_ov_V_pkc_length_secret_key;\n 24 | \tsig->length_signature = OQS_SIG_uov_ov_V_pkc_length_signature;\n 25 | \n 26 | \tsig->keypair = OQS_SIG_uov_ov_V_pkc_keypair;\n 27 | \tsig->sign = OQS_SIG_uov_ov_V_pkc_sign;\n 28 | \tsig->verify = OQS_SIG_uov_ov_V_pkc_verify;\n 29 | \tsig->sign_with_ctx_str = OQS_SIG_uov_ov_V_pkc_sign_with_ctx_str;\n 30 | \tsig->verify_with_ctx_str = OQS_SIG_uov_ov_V_pkc_verify_with_ctx_str;\n 31 | \n 32 | \treturn sig;\n 33 | }\n 34 | \n 35 | extern int pqov_uov_V_pkc_ref_keypair(uint8_t *pk, uint8_t *sk);\n 36 | extern int pqov_uov_V_pkc_ref_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);\n 37 | extern int pqov_uov_V_pkc_ref_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);\n 38 | \n 39 | #if defined(OQS_ENABLE_SIG_uov_ov_V_pkc_neon)\n 40 | extern int pqov_uov_V_pkc_neon_keypair(uint8_t *pk, uint8_t *sk);\n 41 | extern int pqov_uov_V_pkc_neon_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);\n 42 | extern int pqov_uov_V_pkc_neon_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);\n 43 | #endif\n 44 | \n 45 | #if defined(OQS_ENABLE_SIG_uov_ov_V_pkc_avx2)\n 46 | extern int pqov_uov_V_pkc_avx2_keypair(uint8_t *pk, uint8_t *sk);\n 47 | extern int pqov_uov_V_pkc_avx2_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);\n 48 | extern int pqov_uov_V_pkc_avx2_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);\n 49 | #endif\n 50 | \n 51 | OQS_API OQS_STATUS OQS_SIG_uov_ov_V_pkc_keypair(uint8_t *public_key, uint8_t *secret_key) {\n 52 | #if defined(OQS_ENABLE_SIG_uov_ov_V_pkc_neon)\n 53 | #if defined(OQS_DIST_BUILD)\n 54 | \tif (OQS_CPU_has_extension(OQS_CPU_EXT_ARM_NEON)) {\n 55 | #endif /* OQS_DIST_BUILD */\n 56 | \t\treturn (OQS_STATUS) pqov_uov_V_pkc_neon_keypair(public_key, secret_key);\n 57 | #if defined(OQS_DIST_BUILD)\n 58 | \t} else {\n 59 | \t\treturn (OQS_STATUS) pqov_uov_V_pkc_ref_keypair(public_key, secret_key);\n 60 | \t}\n 61 | #endif /* OQS_DIST_BUILD */\n 62 | #elif defined(OQS_ENABLE_SIG_uov_ov_V_pkc_avx2)\n 63 | #if defined(OQS_DIST_BUILD)\n 64 | \tif (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {\n 65 | #endif /* OQS_DIST_BUILD */\n 66 | \t\treturn (OQS_STATUS) pqov_uov_V_pkc_avx2_keypair(public_key, secret_key);\n 67 | #if defined(OQS_DIST_BUILD)\n 68 | \t} else {\n 69 | \t\treturn (OQS_STATUS) pqov_uov_V_pkc_ref_keypair(public_key, secret_key);\n 70 | \t}\n 71 | #endif /* OQS_DIST_BUILD */\n 72 | #else\n 73 | \treturn (OQS_STATUS) pqov_uov_V_pkc_ref_keypair(public_key, secret_key);\n 74 | #endif\n 75 | }\n 76 | \n 77 | OQS_API OQS_STATUS OQS_SIG_uov_ov_V_pkc_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key) {\n 78 | #if defined(OQS_ENABLE_SIG_uov_ov_V_pkc_neon)\n 79 | #if defined(OQS_DIST_BUILD)\n 80 | \tif (OQS_CPU_has_extension(OQS_CPU_EXT_ARM_NEON)) {\n 81 | #endif /* OQS_DIST_BUILD */\n 82 | \t\treturn (OQS_STATUS) pqov_uov_V_pkc_neon_signature(signature, signature_len, message, message_len, secret_key);\n 83 | #if defined(OQS_DIST_BUILD)\n 84 | \t} else {\n 85 | \t\treturn (OQS_STATUS) pqov_uov_V_pkc_ref_signature(signature, signature_len, message, message_len, secret_key);\n 86 | \t}\n 87 | #endif /* OQS_DIST_BUILD */\n 88 | #elif defined(OQS_ENABLE_SIG_uov_ov_V_pkc_avx2)\n 89 | #if defined(OQS_DIST_BUILD)\n 90 | \tif (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {\n 91 | #endif /* OQS_DIST_BUILD */\n 92 | \t\treturn (OQS_STATUS) pqov_uov_V_pkc_avx2_signature(signature, signature_len, message, message_len, secret_key);\n 93 | #if defined(OQS_DIST_BUILD)\n 94 | \t} else {\n> 95 | \t\treturn (OQS_STATUS) pqov_uov_V_pkc_ref_signature(signature, signature_len, message, message_len, secret_key);\n 96 | \t}\n 97 | #endif /* OQS_DIST_BUILD */\n 98 | #else\n 99 | \treturn (OQS_STATUS) pqov_uov_V_pkc_ref_signature(signature, signature_len, message, message_len, secret_key);\n 100 | #endif\n 101 | }\n 102 | \n 103 | OQS_API OQS_STATUS OQS_SIG_uov_ov_V_pkc_verify(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key) {\n 104 | #if defined(OQS_ENABLE_SIG_uov_ov_V_pkc_neon)\n 105 | #if defined(OQS_DIST_BUILD)\n 106 | \tif (OQS_CPU_has_extension(OQS_CPU_EXT_ARM_NEON)) {\n 107 | #endif /* OQS_DIST_BUILD */\n 108 | \t\treturn (OQS_STATUS) pqov_uov_V_pkc_neon_verify(signature, signature_len, message, message_len, public_key);\n 109 | #if defined(OQS_DIST_BUILD)\n 110 | \t} else {\n 111 | \t\treturn (OQS_STATUS) pqov_uov_V_pkc_ref_verify(signature, signature_len, message, message_len, public_key);\n 112 | \t}\n 113 | #endif /* OQS_DIST_BUILD */\n 114 | #elif defined(OQS_ENABLE_SIG_uov_ov_V_pkc_avx2)\n 115 | #if defined(OQS_DIST_BUILD)\n 116 | \tif (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {\n 117 | #endif /* OQS_DIST_BUILD */\n 118 | \t\treturn (OQS_STATUS) pqov_uov_V_pkc_avx2_verify(signature, signature_len, message, message_len, public_key);\n 119 | #if defined(OQS_DIST_BUILD)\n 120 | \t} else {\n 121 | \t\treturn (OQS_STATUS) pqov_uov_V_pkc_ref_verify(signature, signature_len, message, message_len, public_key);\n 122 | \t}\n 123 | #endif /* OQS_DIST_BUILD */\n 124 | #else\n 125 | \treturn (OQS_STATUS) pqov_uov_V_pkc_ref_verify(signature, signature_len, message, message_len, public_key);\n 126 | #endif\n 127 | }\n 128 | \n 129 | OQS_API OQS_STATUS OQS_SIG_uov_ov_V_pkc_sign_with_ctx_str(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *ctx_str, size_t ctx_str_len, const uint8_t *secret_key) {\n 130 | \tif (ctx_str == NULL && ctx_str_len == 0) {\n 131 | \t\treturn OQS_SIG_uov_ov_V_pkc_sign(signature, signature_len, message, message_len, secret_key);\n 132 | \t} else {\n 133 | \t\treturn OQS_ERROR;\n 134 | \t}\n 135 | }\n 136 | \n 137 | OQS_API OQS_STATUS OQS_SIG_uov_ov_V_pkc_verify_with_ctx_str(const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *ctx_str, size_t ctx_str_len, const uint8_t *public_key) {\n 138 | \tif (ctx_str == NULL && ctx_str_len == 0) {\n 139 | \t\treturn OQS_SIG_uov_ov_V_pkc_verify(message, message_len, signature, signature_len, public_key);\n 140 | \t} else {\n 141 | \t\treturn OQS_ERROR;\n 142 | \t}\n 143 | }\n 144 | #endif", "src_commits": "[{\"path\":\"/src/liboqs\",\"rev\":\"0e325ccc2d96d37e7433ff8938550d8111b3931c\",\"url\":\"https://github.com/open-quantum-safe/liboqs.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_test_sig\"]", "cnt": 0, "coverage_keys": "[\"/src/liboqs/src/sig/uov/sig_uov_ov_V_pkc.c\"]", "target_text": "Reach line at /src/liboqs/src/sig/uov/sig_uov_ov_V_pkc.c:95 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-liboqs:v2026-07-test1@sha256:b00578ef6bc10a015619ddcf614cb217e8a1ecae49b3da9eba084a3db59e604a", "runtime_digest": "sha256:b00578ef6bc10a015619ddcf614cb217e8a1ecae49b3da9eba084a3db59e604a", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "liboqs:merged:src/liboqs/src/kem/classic_mceliece/pqclean_mceliece348864f_clean/pk_gen.c:83", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "liboqs", "harness": "merged", "harness_binaries": "[\"fuzz_test_kem\", \"fuzz_test_sig\", \"fuzz_test_sig_stfl_lms\", \"fuzz_test_sig_stfl_xmss\"]", "language": "c", "file": "/src/liboqs/src/kem/classic_mceliece/pqclean_mceliece348864f_clean/pk_gen.c", "line_start": 83, "line_end": 83, "line_count": 1, "function": "", "source_snippet": " 1 | /*\n 2 | This file is for public-key generation\n 3 | */\n 4 | \n 5 | #include \n 6 | #include \n 7 | #include \n 8 | #include \n 9 | \n 10 | #include \"controlbits.h\"\n 11 | #include \"benes.h\"\n 12 | #include \"crypto_declassify.h\"\n 13 | #include \"crypto_uint64.h\"\n 14 | #include \"params.h\"\n 15 | #include \"pk_gen.h\"\n 16 | #include \"root.h\"\n 17 | #include \"uint64_sort.h\"\n 18 | #include \"util.h\"\n 19 | \n 20 | static crypto_uint64 uint64_is_equal_declassify(uint64_t t, uint64_t u) {\n 21 | crypto_uint64 mask = crypto_uint64_equal_mask(t, u);\n 22 | crypto_declassify(&mask, sizeof mask);\n 23 | return mask;\n 24 | }\n 25 | \n 26 | static crypto_uint64 uint64_is_zero_declassify(uint64_t t) {\n 27 | crypto_uint64 mask = crypto_uint64_zero_mask(t);\n 28 | crypto_declassify(&mask, sizeof mask);\n 29 | return mask;\n 30 | }\n 31 | \n 32 | #define min(a, b) (((a) < (b)) ? (a) : (b))\n 33 | \n 34 | /* return number of trailing zeros of the non-zero input in */\n 35 | static inline int ctz(uint64_t in) {\n 36 | int i, b, m = 0, r = 0;\n 37 | \n 38 | for (i = 0; i < 64; i++) {\n 39 | b = (in >> i) & 1;\n 40 | m |= b;\n 41 | r += (m ^ 1) & (b ^ 1);\n 42 | }\n 43 | \n 44 | return r;\n 45 | }\n 46 | \n 47 | static inline uint64_t same_mask(uint16_t x, uint16_t y) {\n 48 | uint64_t mask;\n 49 | \n 50 | mask = x ^ y;\n 51 | mask -= 1;\n 52 | mask >>= 63;\n 53 | mask = -mask;\n 54 | \n 55 | return mask;\n 56 | }\n 57 | \n 58 | static int mov_columns(uint8_t mat[][ SYS_N / 8 ], int16_t *pi, uint64_t *pivots) {\n 59 | int i, j, k, s, block_idx, row;\n 60 | uint64_t buf[64], ctz_list[32], t, d, mask, one = 1;\n 61 | \n 62 | row = PK_NROWS - 32;\n 63 | block_idx = row / 8;\n 64 | \n 65 | // extract the 32x64 matrix\n 66 | \n 67 | for (i = 0; i < 32; i++) {\n 68 | buf[i] = load8( &mat[ row + i ][ block_idx ] );\n 69 | }\n 70 | \n 71 | // compute the column indices of pivots by Gaussian elimination.\n 72 | // the indices are stored in ctz_list\n 73 | \n 74 | *pivots = 0;\n 75 | \n 76 | for (i = 0; i < 32; i++) {\n 77 | t = buf[i];\n 78 | for (j = i + 1; j < 32; j++) {\n 79 | t |= buf[j];\n 80 | }\n 81 | \n 82 | if (uint64_is_zero_declassify(t)) {\n> 83 | return -1; // return if buf is not full rank\n 84 | }\n 85 | \n 86 | ctz_list[i] = s = ctz(t);\n 87 | *pivots |= one << ctz_list[i];\n 88 | \n 89 | for (j = i + 1; j < 32; j++) {\n 90 | mask = (buf[i] >> s) & 1;\n 91 | mask -= 1;\n 92 | buf[i] ^= buf[j] & mask;\n 93 | }\n 94 | for (j = i + 1; j < 32; j++) {\n 95 | mask = (buf[j] >> s) & 1;\n 96 | mask = -mask;\n 97 | buf[j] ^= buf[i] & mask;\n 98 | }\n 99 | }\n 100 | \n 101 | // updating permutation\n 102 | \n 103 | for (j = 0; j < 32; j++) {\n 104 | for (k = j + 1; k < 64; k++) {\n 105 | d = pi[ row + j ] ^ pi[ row + k ];\n 106 | d &= same_mask((uint16_t)k, (uint16_t)ctz_list[j]);\n 107 | pi[ row + j ] ^= d;\n 108 | pi[ row + k ] ^= d;\n 109 | }\n 110 | }\n 111 | \n 112 | // moving columns of mat according to the column indices of pivots\n 113 | \n 114 | for (i = 0; i < PK_NROWS; i++) {\n 115 | t = load8( &mat[ i ][ block_idx ] );\n 116 | \n 117 | for (j = 0; j < 32; j++) {\n 118 | d = t >> j;\n 119 | d ^= t >> ctz_list[j];\n 120 | d &= 1;\n 121 | \n 122 | t ^= d << ctz_list[j];\n 123 | t ^= d << j;\n 124 | }\n 125 | \n 126 | store8( &mat[ i ][ block_idx ], t );\n 127 | }\n 128 | \n 129 | return 0;\n 130 | }\n 131 | \n 132 | /* input: secret key sk */\n 133 | /* output: public key pk */\n 134 | int pk_gen(unsigned char *pk, unsigned char *sk, const uint32_t *perm, int16_t *pi, uint64_t *pivots) {\n 135 | int i, j, k;\n 136 | int row, c;\n 137 | \n 138 | uint64_t buf[ 1 << GFBITS ];\n 139 | \n 140 | unsigned char mat[ PK_NROWS ][ SYS_N / 8 ];\n 141 | unsigned char mask;\n 142 | unsigned char b;\n 143 | \n 144 | gf g[ SYS_T + 1 ]; // Goppa polynomial\n 145 | gf L[ SYS_N ]; // support\n 146 | gf inv[ SYS_N ];\n 147 | \n 148 | //\n 149 | \n 150 | g[ SYS_T ] = 1;\n 151 | \n 152 | for (i = 0; i < SYS_T; i++) {\n 153 | g[i] = load_gf(sk);\n 154 | sk += 2;\n 155 | }\n 156 | \n 157 | for (i = 0; i < (1 << GFBITS); i++) {\n 158 | buf[i] = perm[i];\n 159 | buf[i] <<= 31;\n 160 | buf[i] |= i;\n 161 | }\n 162 | \n 163 | uint64_sort(buf, 1 << GFBITS);\n 164 | \n 165 | for (i = 1; i < (1 << GFBITS); i++) {\n 166 | if (uint64_is_equal_declassify(buf[i - 1] >> 31, buf[i] >> 31)) {\n 167 | return -1;\n 168 | }\n 169 | }\n 170 | \n 171 | for (i = 0; i < (1 << GFBITS); i++) {\n 172 | pi[i] = buf[i] & GFMASK;\n 173 | }\n 174 | for (i = 0; i < SYS_N; i++) {\n 175 | L[i] = bitrev(pi[i]);\n 176 | }\n 177 | \n 178 | // filling the matrix\n 179 | \n 180 | root(inv, g, L);\n 181 | \n 182 | for (i = 0; i < SYS_N; i++) {\n 183 | inv[i] = gf_inv(inv[i]);", "src_commits": "[{\"path\":\"/src/liboqs\",\"rev\":\"0e325ccc2d96d37e7433ff8938550d8111b3931c\",\"url\":\"https://github.com/open-quantum-safe/liboqs.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_test_kem\",\"fuzz_test_sig\"]", "cnt": 0, "coverage_keys": "[\"/src/liboqs/src/kem/classic_mceliece/pqclean_mceliece348864f_clean/pk_gen.c\"]", "target_text": "Reach line at /src/liboqs/src/kem/classic_mceliece/pqclean_mceliece348864f_clean/pk_gen.c:83 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-liboqs:v2026-07-test1@sha256:b00578ef6bc10a015619ddcf614cb217e8a1ecae49b3da9eba084a3db59e604a", "runtime_digest": "sha256:b00578ef6bc10a015619ddcf614cb217e8a1ecae49b3da9eba084a3db59e604a", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "liboqs:merged:src/liboqs/src/sig/ml_dsa/mldsa-native_ml-dsa-87_x86_64/mldsa/src/native/x86_64/src/rej_uniform_eta2_avx2.c:94", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "liboqs", "harness": "merged", "harness_binaries": "[\"fuzz_test_kem\", \"fuzz_test_sig\", \"fuzz_test_sig_stfl_lms\", \"fuzz_test_sig_stfl_xmss\"]", "language": "c", "file": "/src/liboqs/src/sig/ml_dsa/mldsa-native_ml-dsa-87_x86_64/mldsa/src/native/x86_64/src/rej_uniform_eta2_avx2.c", "line_start": 94, "line_end": 94, "line_count": 1, "function": "", "source_snippet": " 1 | /*\n 2 | * Copyright (c) The mldsa-native project authors\n 3 | * SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT\n 4 | */\n 5 | \n 6 | /* References\n 7 | * ==========\n 8 | *\n 9 | * - [REF_AVX2]\n 10 | * CRYSTALS-Dilithium optimized AVX2 implementation\n 11 | * Bai, Ducas, Kiltz, Lepoint, Lyubashevsky, Schwabe, Seiler, Stehl\u00e9\n 12 | * https://github.com/pq-crystals/dilithium/tree/master/avx2\n 13 | */\n 14 | \n 15 | /*\n 16 | * This file is derived from the public domain\n 17 | * AVX2 Dilithium implementation @[REF_AVX2].\n 18 | */\n 19 | \n 20 | #include \"../../../common.h\"\n 21 | \n 22 | #if defined(MLD_ARITH_BACKEND_X86_64_DEFAULT) && \\\n 23 | !defined(MLD_CONFIG_MULTILEVEL_NO_SHARED) && \\\n 24 | (defined(MLD_CONFIG_MULTILEVEL_WITH_SHARED) || MLDSA_ETA == 2)\n 25 | \n 26 | #include \n 27 | #include \"arith_native_x86_64.h\"\n 28 | #include \"consts.h\"\n 29 | \n 30 | #define MLD_AVX2_ETA2 2\n 31 | \n 32 | /*\n 33 | * Reference: In the pqcrystals implementation this function is called\n 34 | * rej_eta_avx and supports multiple values for ETA via preprocessor\n 35 | * conditionals. We move the conditionals to the frontend.\n 36 | */\n 37 | unsigned int mld_rej_uniform_eta2_avx2(\n 38 | int32_t *MLD_RESTRICT r,\n 39 | const uint8_t buf[MLD_AVX2_REJ_UNIFORM_ETA2_BUFLEN])\n 40 | {\n 41 | unsigned int ctr, pos;\n 42 | uint32_t good;\n 43 | __m256i f0, f1, f2;\n 44 | __m128i g0, g1;\n 45 | const __m256i mask = _mm256_set1_epi8(15);\n 46 | const __m256i eta = _mm256_set1_epi8(MLD_AVX2_ETA2);\n 47 | const __m256i bound = mask;\n 48 | /* check-magic: -6560 == 32*round(-2**10 / 5) */\n 49 | const __m256i v = _mm256_set1_epi32(-6560);\n 50 | const __m256i p = _mm256_set1_epi32(5);\n 51 | \n 52 | ctr = pos = 0;\n 53 | while (ctr <= MLDSA_N - 8 && pos <= MLD_AVX2_REJ_UNIFORM_ETA2_BUFLEN - 16)\n 54 | {\n 55 | f0 = _mm256_cvtepu8_epi16(_mm_loadu_si128((__m128i *)&buf[pos]));\n 56 | f1 = _mm256_slli_epi16(f0, 4);\n 57 | f0 = _mm256_or_si256(f0, f1);\n 58 | f0 = _mm256_and_si256(f0, mask);\n 59 | \n 60 | f1 = _mm256_sub_epi8(f0, bound);\n 61 | f0 = _mm256_sub_epi8(eta, f0);\n 62 | good = (uint32_t)_mm256_movemask_epi8(f1);\n 63 | \n 64 | g0 = _mm256_castsi256_si128(f0);\n 65 | g1 = _mm_loadl_epi64((__m128i *)&mld_rej_uniform_table[good & 0xFF]);\n 66 | g1 = _mm_shuffle_epi8(g0, g1);\n 67 | f1 = _mm256_cvtepi8_epi32(g1);\n 68 | f2 = _mm256_mulhrs_epi16(f1, v);\n 69 | f2 = _mm256_mullo_epi16(f2, p);\n 70 | f1 = _mm256_add_epi32(f1, f2);\n 71 | _mm256_storeu_si256((__m256i *)&r[ctr], f1);\n 72 | ctr += (unsigned)_mm_popcnt_u32(good & 0xFF);\n 73 | good >>= 8;\n 74 | pos += 4;\n 75 | \n 76 | if (ctr > MLDSA_N - 8)\n 77 | {\n 78 | break;\n 79 | }\n 80 | g0 = _mm_bsrli_si128(g0, 8);\n 81 | g1 = _mm_loadl_epi64((__m128i *)&mld_rej_uniform_table[good & 0xFF]);\n 82 | g1 = _mm_shuffle_epi8(g0, g1);\n 83 | f1 = _mm256_cvtepi8_epi32(g1);\n 84 | f2 = _mm256_mulhrs_epi16(f1, v);\n 85 | f2 = _mm256_mullo_epi16(f2, p);\n 86 | f1 = _mm256_add_epi32(f1, f2);\n 87 | _mm256_storeu_si256((__m256i *)&r[ctr], f1);\n 88 | ctr += (unsigned)_mm_popcnt_u32(good & 0xFF);\n 89 | good >>= 8;\n 90 | pos += 4;\n 91 | \n 92 | if (ctr > MLDSA_N - 8)\n 93 | {\n> 94 | break;\n 95 | }\n 96 | g0 = _mm256_extracti128_si256(f0, 1);\n 97 | g1 = _mm_loadl_epi64((__m128i *)&mld_rej_uniform_table[good & 0xFF]);\n 98 | g1 = _mm_shuffle_epi8(g0, g1);\n 99 | f1 = _mm256_cvtepi8_epi32(g1);\n 100 | f2 = _mm256_mulhrs_epi16(f1, v);\n 101 | f2 = _mm256_mullo_epi16(f2, p);\n 102 | f1 = _mm256_add_epi32(f1, f2);\n 103 | _mm256_storeu_si256((__m256i *)&r[ctr], f1);\n 104 | ctr += (unsigned)_mm_popcnt_u32(good & 0xFF);\n 105 | good >>= 8;\n 106 | pos += 4;\n 107 | \n 108 | if (ctr > MLDSA_N - 8)\n 109 | {\n 110 | break;\n 111 | }\n 112 | g0 = _mm_bsrli_si128(g0, 8);\n 113 | g1 = _mm_loadl_epi64((__m128i *)&mld_rej_uniform_table[good]);\n 114 | g1 = _mm_shuffle_epi8(g0, g1);\n 115 | f1 = _mm256_cvtepi8_epi32(g1);\n 116 | f2 = _mm256_mulhrs_epi16(f1, v);\n 117 | f2 = _mm256_mullo_epi16(f2, p);\n 118 | f1 = _mm256_add_epi32(f1, f2);\n 119 | _mm256_storeu_si256((__m256i *)&r[ctr], f1);\n 120 | ctr += (unsigned)_mm_popcnt_u32(good);\n 121 | pos += 4;\n 122 | }\n 123 | \n 124 | while (ctr < MLDSA_N && pos < MLD_AVX2_REJ_UNIFORM_ETA2_BUFLEN)\n 125 | {\n 126 | uint32_t t0 = buf[pos] & 0x0F;\n 127 | uint32_t t1 = buf[pos++] >> 4;\n 128 | \n 129 | if (t0 < 15)\n 130 | {\n 131 | t0 = t0 - (205 * t0 >> 10) * 5;\n 132 | r[ctr++] = (int32_t)(2 - t0);\n 133 | }\n 134 | if (t1 < 15 && ctr < MLDSA_N)\n 135 | {\n 136 | t1 = t1 - (205 * t1 >> 10) * 5;\n 137 | r[ctr++] = (int32_t)(2 - t1);\n 138 | }\n 139 | }\n 140 | \n 141 | return ctr;\n 142 | }\n 143 | \n 144 | #else /* MLD_ARITH_BACKEND_X86_64_DEFAULT && !MLD_CONFIG_MULTILEVEL_NO_SHARED \\\n 145 | && (MLD_CONFIG_MULTILEVEL_WITH_SHARED || MLDSA_ETA == 2) */\n 146 | \n 147 | MLD_EMPTY_CU(avx2_rej_uniform_eta2)\n 148 | \n 149 | #endif /* !(MLD_ARITH_BACKEND_X86_64_DEFAULT && \\\n 150 | !MLD_CONFIG_MULTILEVEL_NO_SHARED && \\\n 151 | (MLD_CONFIG_MULTILEVEL_WITH_SHARED || MLDSA_ETA == 2)) */\n 152 | \n 153 | /* To facilitate single-compilation-unit (SCU) builds, undefine all macros.\n 154 | * Don't modify by hand -- this is auto-generated by scripts/autogen. */\n 155 | #undef MLD_AVX2_ETA2", "src_commits": "[{\"path\":\"/src/liboqs\",\"rev\":\"0e325ccc2d96d37e7433ff8938550d8111b3931c\",\"url\":\"https://github.com/open-quantum-safe/liboqs.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_test_kem\",\"fuzz_test_sig\"]", "cnt": 0, "coverage_keys": "[\"/src/liboqs/src/sig/ml_dsa/mldsa-native_ml-dsa-87_x86_64/mldsa/src/native/x86_64/src/rej_uniform_eta2_avx2.c\"]", "target_text": "Reach line at /src/liboqs/src/sig/ml_dsa/mldsa-native_ml-dsa-87_x86_64/mldsa/src/native/x86_64/src/rej_uniform_eta2_avx2.c:94 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-liboqs:v2026-07-test1@sha256:b00578ef6bc10a015619ddcf614cb217e8a1ecae49b3da9eba084a3db59e604a", "runtime_digest": "sha256:b00578ef6bc10a015619ddcf614cb217e8a1ecae49b3da9eba084a3db59e604a", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "liboqs:merged:src/liboqs/src/sig/slh_dsa/wrappers/prehash_sha3_256/slh_dsa_sha3_256_prehash_shake_256s.c:16", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "liboqs", "harness": "merged", "harness_binaries": "[\"fuzz_test_kem\", \"fuzz_test_sig\", \"fuzz_test_sig_stfl_lms\", \"fuzz_test_sig_stfl_xmss\"]", "language": "c", "file": "/src/liboqs/src/sig/slh_dsa/wrappers/prehash_sha3_256/slh_dsa_sha3_256_prehash_shake_256s.c", "line_start": 16, "line_end": 16, "line_count": 1, "function": "", "source_snippet": " 1 | // SPDX-License-Identifier: MIT\n 2 | \n 3 | #include \n 4 | \n 5 | #include \"../../sig_slh_dsa.h\"\n 6 | #include \"../../slh_dsa_c/slh_dsa.h\"\n 7 | #include \"../../slh_dsa_c/slh_prehash.h\"\n 8 | #include \n 9 | \n 10 | \n 11 | #if defined(OQS_ENABLE_SIG_slh_dsa_sha3_256_prehash_shake_256s)\n 12 | OQS_SIG *OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_new(void) {\n 13 | \n 14 | \tOQS_SIG *sig = OQS_MEM_malloc(sizeof(OQS_SIG));\n 15 | \tif(sig == NULL) {\n> 16 | \t\treturn NULL;\n 17 | \t}\n 18 | \tsig->method_name = OQS_SIG_alg_slh_dsa_sha3_256_prehash_shake_256s;\n 19 | \tsig->alg_version = \"FIPS205\";\n 20 | \n 21 | \tsig->claimed_nist_level = 5;\n 22 | \tsig->euf_cma = true;\n 23 | \tsig->suf_cma = false;\n 24 | \tsig->sig_with_ctx_support = true;\n 25 | \n 26 | \tsig->length_public_key = OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_length_public_key;\n 27 | \tsig->length_secret_key = OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_length_secret_key;\n 28 | \tsig->length_signature = OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_length_signature;\n 29 | \n 30 | \tsig->keypair = OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_keypair;\n 31 | \tsig->sign = OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_sign;\n 32 | \tsig->verify = OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_verify;\n 33 | \tsig->sign_with_ctx_str = OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_sign_with_ctx_str;\n 34 | \tsig->verify_with_ctx_str = OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_verify_with_ctx_str;\n 35 | \n 36 | \treturn sig;\n 37 | }\n 38 | \n 39 | static int slh_randombytes(uint8_t *x, size_t xlen) {\n 40 | \t\n 41 | \tOQS_randombytes(x, xlen);\n 42 | \treturn OQS_SUCCESS;\n 43 | }\n 44 | \n 45 | OQS_API OQS_STATUS OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_keypair(uint8_t *public_key, uint8_t *secret_key) {\n 46 | \t\n 47 | \tconst slh_param_t *prm = &slh_dsa_shake_256s;\n 48 | \tint(*rbg)(uint8_t *x, size_t xlen) = slh_randombytes;\n 49 | \treturn slh_keygen(secret_key, public_key, rbg, prm);\n 50 | }\n 51 | \n 52 | OQS_API OQS_STATUS OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_sign(uint8_t *signature, \n 53 | \tsize_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key) {\n 54 | \t\n 55 | \tconst slh_param_t *prm = &slh_dsa_shake_256s;\n 56 | \t\n 57 | \tconst char *ph = \"SHA3-256\";\n 58 | \tconst uint8_t *ctx_str = NULL;\n 59 | \tconst size_t ctx_str_len = 0;\n 60 | \tuint8_t addrnd[32];\n 61 | \tOQS_randombytes(addrnd, 32);\n 62 | \n 63 | \t*signature_len = hash_slh_sign(signature, message, message_len, ctx_str,\n 64 | \t\tctx_str_len, ph, secret_key, addrnd, prm);\n 65 | \n 66 | \tif(*signature_len == 0) {\n 67 | \t\treturn OQS_ERROR;\n 68 | \t}\n 69 | \treturn OQS_SUCCESS;\n 70 | }\n 71 | \n 72 | OQS_API OQS_STATUS OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_verify(const uint8_t *message, \n 73 | \tsize_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key) {\n 74 | \t\n 75 | \tconst slh_param_t *prm = &slh_dsa_shake_256s;\n 76 | \tconst char *ph = \"SHA3-256\";\n 77 | \tconst uint8_t *ctx_str = NULL;\n 78 | \tconst size_t ctx_str_len = 0;\n 79 | \n 80 | \tint res = hash_slh_verify(message, message_len, signature, signature_len,\n 81 | \t\tctx_str, ctx_str_len, ph, public_key, prm);\n 82 | \n 83 | \tif(res == 0) {\n 84 | \t\treturn OQS_ERROR;\n 85 | \t}\n 86 | \treturn OQS_SUCCESS;\n 87 | }\n 88 | \n 89 | OQS_API OQS_STATUS OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_sign_with_ctx_str(uint8_t *signature, \n 90 | \tsize_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *ctx_str, \n 91 | \tsize_t ctx_str_len, const uint8_t *secret_key) {\n 92 | \t\n 93 | \tconst slh_param_t *prm = &slh_dsa_shake_256s;\n 94 | \tconst char *ph = \"SHA3-256\";\n 95 | \tuint8_t addrnd[32];\n 96 | \tOQS_randombytes(addrnd, 32);\n 97 | \n 98 | \t*signature_len = hash_slh_sign(signature, message, message_len, ctx_str,\n 99 | \t\tctx_str_len, ph, secret_key, addrnd, prm);\n 100 | \n 101 | \tif(*signature_len == 0) {\n 102 | \t\treturn OQS_ERROR;\n 103 | \t}\n 104 | \treturn OQS_SUCCESS;\n 105 | }\n 106 | \n 107 | OQS_API OQS_STATUS OQS_SIG_slh_dsa_sha3_256_prehash_shake_256s_verify_with_ctx_str(const uint8_t *message, \n 108 | \tsize_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *ctx_str, \n 109 | \tsize_t ctx_str_len, const uint8_t *public_key) {\n 110 | \t\n 111 | \tconst slh_param_t *prm = &slh_dsa_shake_256s;\n 112 | \tconst char *ph = \"SHA3-256\";\n 113 | \tint res = hash_slh_verify(message, message_len, signature, signature_len,\n 114 | \t\tctx_str, ctx_str_len, ph, public_key, prm);\n 115 | \n 116 | if(res == 0) {", "src_commits": "[{\"path\":\"/src/liboqs\",\"rev\":\"0e325ccc2d96d37e7433ff8938550d8111b3931c\",\"url\":\"https://github.com/open-quantum-safe/liboqs.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"fuzz_test_sig\"]", "cnt": 0, "coverage_keys": "[\"/src/liboqs/src/sig/slh_dsa/wrappers/prehash_sha3_256/slh_dsa_sha3_256_prehash_shake_256s.c\"]", "target_text": "Reach line at /src/liboqs/src/sig/slh_dsa/wrappers/prehash_sha3_256/slh_dsa_sha3_256_prehash_shake_256s.c:16 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-liboqs:v2026-07-test1@sha256:b00578ef6bc10a015619ddcf614cb217e8a1ecae49b3da9eba084a3db59e604a", "runtime_digest": "sha256:b00578ef6bc10a015619ddcf614cb217e8a1ecae49b3da9eba084a3db59e604a", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner:ubuntu-24-04", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "libraw:merged:src/libraw/src/metadata/fuji.cpp:480", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "libraw", "harness": "merged", "harness_binaries": "[\"libraw_cr2_fuzzer\", \"libraw_fuzzer\", \"libraw_nef_fuzzer\", \"libraw_raf_fuzzer\"]", "language": "c++", "file": "/src/libraw/src/metadata/fuji.cpp", "line_start": 480, "line_end": 480, "line_count": 1, "function": "", "source_snippet": " 380 | !strcmp(model, \"X-E4\") ||\n 381 | !strcmp(model, \"X-T30 II\") ||\n 382 | !strcmp(model, \"X-S10\"))\n 383 | is34 = 1;\n 384 | \n 385 | if (imFuji.RAFDataVersion == 0x4500) // X-E1, RAFData gen. 3\n 386 | {\n 387 | wb_section_offset = 0x13ac;\n 388 | }\n 389 | else if (imFuji.RAFDataVersion == 0x0146 || // X20\n 390 | imFuji.RAFDataVersion == 0x0149 || // X100S\n 391 | imFuji.RAFDataVersion == 0x0249) // X100S\n 392 | {\n 393 | wb_section_offset = 0x1410;\n 394 | }\n 395 | else if (imFuji.RAFDataVersion == 0x014d || // X-M1\n 396 | imFuji.RAFDataVersion == 0x014e) // X-A1, X-A2\n 397 | {\n 398 | wb_section_offset = 0x1474;\n 399 | }\n 400 | else if (imFuji.RAFDataVersion == 0x014f || // X-E2\n 401 | imFuji.RAFDataVersion == 0x024f || // X-E2\n 402 | imFuji.RAFDataVersion == 0x025d || // X-H1\n 403 | imFuji.RAFDataVersion == 0x035d) // X-H1\n 404 | {\n 405 | wb_section_offset = 0x1480;\n 406 | }\n 407 | else if (imFuji.RAFDataVersion == 0x0150) // XQ1, XQ2\n 408 | {\n 409 | wb_section_offset = 0x1414;\n 410 | }\n 411 | else if (imFuji.RAFDataVersion == 0x0151 || // X-T1 w/diff. fws\n 412 | imFuji.RAFDataVersion == 0x0251 || imFuji.RAFDataVersion == 0x0351 ||\n 413 | imFuji.RAFDataVersion == 0x0451 || imFuji.RAFDataVersion == 0x0551)\n 414 | {\n 415 | wb_section_offset = 0x14b0;\n 416 | }\n 417 | else if (imFuji.RAFDataVersion == 0x0152 || // X30\n 418 | imFuji.RAFDataVersion == 0x0153) // X100T\n 419 | {\n 420 | wb_section_offset = 0x1444;\n 421 | }\n 422 | else if (imFuji.RAFDataVersion == 0x0154) // X-T10\n 423 | {\n 424 | wb_section_offset = 0x1824;\n 425 | }\n 426 | else if (imFuji.RAFDataVersion == 0x0155) // X70\n 427 | {\n 428 | wb_section_offset = 0x17b4;\n 429 | }\n 430 | else if (imFuji.RAFDataVersion == 0x0255 || // X-Pro2\n 431 | imFuji.RAFDataVersion == 0x0455)\n 432 | {\n 433 | wb_section_offset = 0x135c;\n 434 | }\n 435 | else if (imFuji.RAFDataVersion == 0x0258 || // X-T2\n 436 | imFuji.RAFDataVersion == 0x025b) // X-T20\n 437 | {\n 438 | wb_section_offset = 0x13dc;\n 439 | }\n 440 | else if (imFuji.RAFDataVersion == 0x0259) // X100F\n 441 | {\n 442 | wb_section_offset = 0x1370;\n 443 | }\n 444 | else if (imFuji.RAFDataVersion == 0x025a || // GFX 50S\n 445 | imFuji.RAFDataVersion == 0x045a)\n 446 | {\n 447 | wb_section_offset = 0x1424;\n 448 | }\n 449 | else if (imFuji.RAFDataVersion == 0x025c) // X-E3\n 450 | {\n 451 | wb_section_offset = 0x141c;\n 452 | }\n 453 | else if (imFuji.RAFDataVersion == 0x025e) // X-T3\n 454 | {\n 455 | wb_section_offset = 0x2014;\n 456 | }\n 457 | else if (imFuji.RAFDataVersion == 0x025f) // X-T30, GFX 50R, GFX 100 (? RAFDataVersion 0x045f)\n 458 | {\n 459 | if (!strcmp(model, \"X-T30\")) {\n 460 | if (PrivateMknBuf.isWB(posPrivateMknBuf + 0x20b8))\n 461 | wb_section_offset = 0x20b8;\n 462 | else if (PrivateMknBuf.isWB(posPrivateMknBuf + 0x20c8))\n 463 | \t\t\t\t\t wb_section_offset = 0x20c8;\n 464 | }\n 465 | else if (!strcmp(model, \"GFX 50R\"))\n 466 | wb_section_offset = 0x1424;\n 467 | else if (!strcmp(model, \"GFX 100\"))\n 468 | wb_section_offset = 0x20e4;\n 469 | }\n 470 | else if (imFuji.RAFDataVersion == 0x0260) // X-Pro3, GFX 100S\n 471 | {\n 472 | if (!strcmp(model, \"X-Pro3\"))\n 473 | wb_section_offset = 0x20e8;\n 474 | else if (!strcmp(model, \"GFX 100S\") || !strcmp(model, \"GFX100S\"))\n 475 | wb_section_offset = 0x2108;\n 476 | }\n 477 | else if (imFuji.RAFDataVersion == 0x0261) // X100V, GFX 50S II\n 478 | {\n 479 | if (!strcmp(model, \"X100V\"))\n> 480 | wb_section_offset = 0x2078;\n 481 | else if (!strcmp(model, \"GFX 50S II\") || !strcmp(model, \"GFX50S II\"))\n 482 | wb_section_offset = 0x214c;\n 483 | }\n 484 | else if (imFuji.RAFDataVersion == 0x0262) // X-T4\n 485 | {\n 486 | if (PrivateMknBuf.isWB(posPrivateMknBuf + 0x21c8))\n 487 | wb_section_offset = 0x21c8;\n 488 | else if (PrivateMknBuf.isWB(posPrivateMknBuf + 0x21cc))\n 489 | wb_section_offset = 0x21cc;\n 490 | }\n 491 | else if (imFuji.RAFDataVersion == 0x0263) // X-H2S\n 492 | {\n 493 | wb_section_offset = 0x0b40;\n 494 | }\n 495 | else if (imFuji.RAFDataVersion == 0x0264) // X-S10, X-H2\n 496 | {\n 497 | if (!strcmp(model, \"X-S10\"))\n 498 | wb_section_offset = 0x21de;\n 499 | else if (!strcmp(model, \"X-H2\"))\n 500 | wb_section_offset = 0x0b3e;\n 501 | }\n 502 | else if ((imFuji.RAFDataVersion == 0x0265) || // X-E4, X-T5\n 503 | (imFuji.RAFDataVersion == 0x0266)) // X-T30 II, X-S20\n 504 | {\n 505 | if (!strcmp(model, \"X-T5\") ||\n 506 | !strcmp(model, \"X-S20\"))\n 507 | wb_section_offset = 0x0c72;\n 508 | else\n 509 | wb_section_offset = 0x21cc;\n 510 | }\n 511 | else if (imFuji.RAFDataVersion == 0x0267) // GFX 100 II\n 512 | {\n 513 | wb_section_offset = 0x0cae;\n 514 | }\n 515 | else if (imFuji.RAFDataVersion == 0x0355) // X-E2S\n 516 | {\n 517 | wb_section_offset = 0x1840;\n 518 | }\n 519 | else if (imFuji.RAFDataVersion == 0x0368) // GFX 100S II\n 520 | {\n 521 | wb_section_offset = 0x0cba;\n 522 | }\n 523 | else if (imFuji.RAFDataVersion == 0x0369) // X100VI\n 524 | {\n 525 | wb_section_offset = 0x0c5a;\n 526 | }\n 527 | else if (imFuji.RAFDataVersion == 0x036a) // X-T50\n 528 | {\n 529 | wb_section_offset = 0x0cca;\n 530 | }\n 531 | else if (imFuji.RAFDataVersion == 0x036b) // X-M5\n 532 | {\n 533 | wb_section_offset = 0x0cea;\n 534 | }\n 535 | \n 536 | /* try for unknown RAF Data versions */\n 537 | else if (!strcmp(model, \"X-Pro2\"))\n 538 | {\n 539 | if (PrivateMknBuf.isWB(posPrivateMknBuf + 0x135c))\n 540 | wb_section_offset = 0x135c;\n 541 | }\n 542 | else if (!strcmp(model, \"X100F\"))\n 543 | {\n 544 | if (PrivateMknBuf.isWB(posPrivateMknBuf + 0x1370))\n 545 | wb_section_offset = 0x1370;\n 546 | }\n 547 | else if (!strcmp(model, \"X-E1\"))\n 548 | {\n 549 | if (PrivateMknBuf.isWB(posPrivateMknBuf + 0x13ac))\n 550 | wb_section_offset = 0x13ac;\n 551 | }\n 552 | else if (!strcmp(model, \"X-T2\") ||\n 553 | !strcmp(model, \"X-T20\"))\n 554 | {\n 555 | if (PrivateMknBuf.isWB(posPrivateMknBuf + 0x13dc))\n 556 | wb_section_offset = 0x13dc;\n 557 | }\n 558 | else if (!strcmp(model, \"X20\") ||\n 559 | !strcmp(model, \"X100S\"))\n 560 | {\n 561 | if (PrivateMknBuf.isWB(posPrivateMknBuf + 0x1410))\n 562 | wb_section_offset = 0x1410;\n 563 | }\n 564 | else if (!strcmp(model, \"XQ1\") ||\n 565 | !strcmp(model, \"XQ2\"))\n 566 | {\n 567 | if (PrivateMknBuf.isWB(posPrivateMknBuf + 0x1414))\n 568 | wb_section_offset = 0x1414;\n 569 | }\n 570 | else if (!strcmp(model, \"X-E3\"))\n 571 | {\n 572 | if (PrivateMknBuf.isWB(posPrivateMknBuf + 0x141c))\n 573 | wb_section_offset = 0x141c;\n 574 | }\n 575 | else if (!strcmp(model, \"GFX 50S\") ||\n 576 | !strcmp(model, \"GFX 50R\"))\n 577 | {\n 578 | if (PrivateMknBuf.isWB(posPrivateMknBuf + 0x1424))\n 579 | wb_section_offset = 0x1424;\n 580 | }", "src_commits": "[{\"path\":\"/src/libraw\",\"rev\":\"f9d5f6565a36abc60e672e2db6e7ca80b6bf642e\",\"url\":\"https://github.com/libraw/libraw\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"libraw_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/libraw/src/metadata/fuji.cpp\"]", "target_text": "Reach line at /src/libraw/src/metadata/fuji.cpp:480 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-libraw:v2026-07-test1@sha256:faa3f5de1db16c0f6b9968ee796375be742b5d8b30f6659ad6150a347c076133", "runtime_digest": "sha256:faa3f5de1db16c0f6b9968ee796375be742b5d8b30f6659ad6150a347c076133", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "libraw:merged:src/libraw/src/postprocessing/dcraw_process.cpp:172", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "libraw", "harness": "merged", "harness_binaries": "[\"libraw_cr2_fuzzer\", \"libraw_fuzzer\", \"libraw_nef_fuzzer\", \"libraw_raf_fuzzer\"]", "language": "c++", "file": "/src/libraw/src/postprocessing/dcraw_process.cpp", "line_start": 172, "line_end": 172, "line_count": 1, "function": "", "source_snippet": " 72 | /* pre subtract black callback: check for it above to disable subtract\n 73 | * inline */\n 74 | \n 75 | if (callbacks.pre_subtractblack_cb)\n 76 | (callbacks.pre_subtractblack_cb)(this);\n 77 | \n 78 | quality = 2 + !IO.fuji_width;\n 79 | \n 80 | if (O.user_qual >= 0)\n 81 | quality = O.user_qual;\n 82 | \n 83 | if (!subtract_inline || !C.data_maximum)\n 84 | {\n 85 | adjust_bl();\n 86 | subtract_black_internal();\n 87 | }\n 88 | \n 89 | if (!(di.decoder_flags & LIBRAW_DECODER_FIXEDMAXC))\n 90 | adjust_maximum();\n 91 | \n 92 | if (O.user_sat > 0)\n 93 | C.maximum = O.user_sat;\n 94 | \n 95 | if (P1.is_foveon)\n 96 | {\n 97 | if (load_raw == &LibRaw::x3f_load_raw)\n 98 | {\n 99 | // Filter out zeroes\n 100 | for (int q = 0; q < S.height * S.width; q++)\n 101 | {\n 102 | for (int c = 0; c < 4; c++)\n 103 | if ((short)imgdata.image[q][c] < 0)\n 104 | imgdata.image[q][c] = 0;\n 105 | }\n 106 | }\n 107 | SET_PROC_FLAG(LIBRAW_PROGRESS_FOVEON_INTERPOLATE);\n 108 | }\n 109 | \n 110 | if (O.green_matching && !O.half_size)\n 111 | {\n 112 | green_matching();\n 113 | }\n 114 | \n 115 | if (callbacks.pre_scalecolors_cb)\n 116 | (callbacks.pre_scalecolors_cb)(this);\n 117 | \n 118 | if (!O.no_auto_scale)\n 119 | {\n 120 | scale_colors();\n 121 | SET_PROC_FLAG(LIBRAW_PROGRESS_SCALE_COLORS);\n 122 | }\n 123 | \n 124 | if (callbacks.pre_preinterpolate_cb)\n 125 | (callbacks.pre_preinterpolate_cb)(this);\n 126 | \n 127 | pre_interpolate();\n 128 | \n 129 | SET_PROC_FLAG(LIBRAW_PROGRESS_PRE_INTERPOLATE);\n 130 | \n 131 | if (O.dcb_iterations >= 0)\n 132 | iterations = O.dcb_iterations;\n 133 | if (O.dcb_enhance_fl >= 0)\n 134 | dcb_enhance = O.dcb_enhance_fl;\n 135 | if (O.fbdd_noiserd >= 0)\n 136 | noiserd = O.fbdd_noiserd;\n 137 | \n 138 | /* pre-exposure correction callback */\n 139 | \n 140 | if (O.exp_correc > 0)\n 141 | {\n 142 | expos = O.exp_shift;\n 143 | preser = O.exp_preser;\n 144 | exp_bef(expos, preser);\n 145 | }\n 146 | \n 147 | if (callbacks.pre_interpolate_cb)\n 148 | (callbacks.pre_interpolate_cb)(this);\n 149 | \n 150 | /* post-exposure correction fallback */\n 151 | if (P1.filters && !O.no_interpolation)\n 152 | {\n 153 | \t int real_colors = P1.colors;\n 154 | \t int bad_bayer = 0;\n 155 | \t if (P1.filters > 1000)\n 156 | \t\t for (int r = 0; r < 4; r++)\n 157 | \t\t\t for (int c = 0; c < 8; c++)\n 158 | \t\t\t {\n 159 | \t\t\t\t real_colors = MAX(COLOR(r, c) + 1, real_colors);\n 160 | \t\t\t\t if (P1.filters > 1000)\n 161 | \t\t\t\t {\n 162 | \t\t\t\t\t // Normal bayer: adjacent pixels horizontally/vertically have different colors\n 163 | \t\t\t\t\t bad_bayer += (FC(r, c) == FC(r + 1, c));\n 164 | \t\t\t\t\t bad_bayer += (FC(r, c) == FC(r, c + 1));\n 165 | \t\t\t\t }\n 166 | \t\t\t }\n 167 | \n 168 | if (noiserd > 0 && P1.colors == 3 && real_colors == 3 && P1.filters > 1000)\n 169 | fbdd(noiserd);\n 170 | \n 171 | if (P1.filters > 1000 && callbacks.interpolate_bayer_cb)\n> 172 | (callbacks.interpolate_bayer_cb)(this);\n 173 | else if (P1.filters == 9 && callbacks.interpolate_xtrans_cb)\n 174 | (callbacks.interpolate_xtrans_cb)(this);\n 175 | else if (quality == 0)\n 176 | lin_interpolate();\n 177 | else if (quality == 1 || P1.colors > 3 || real_colors > 3 || bad_bayer || (P1.filters != LIBRAW_XTRANS && P1.filters <= 1000))\n 178 | vng_interpolate();\n 179 | else if (quality == 2 && P1.filters > 1000)\n 180 | ppg_interpolate();\n 181 | else if (P1.filters == LIBRAW_XTRANS)\n 182 | {\n 183 | // Fuji X-Trans\n 184 | xtrans_interpolate(quality > 2 ? 3 : 1);\n 185 | }\n 186 | else if (quality == 3)\n 187 | ahd_interpolate(); // really don't need it here due to fallback op\n 188 | else if (quality == 4)\n 189 | dcb(iterations, dcb_enhance);\n 190 | \n 191 | else if (quality == 11)\n 192 | dht_interpolate();\n 193 | else if (quality == 12)\n 194 | aahd_interpolate();\n 195 | // fallback to AHD\n 196 | else\n 197 | {\n 198 | ahd_interpolate();\n 199 | imgdata.process_warnings |= LIBRAW_WARN_FALLBACK_TO_AHD;\n 200 | }\n 201 | \n 202 | SET_PROC_FLAG(LIBRAW_PROGRESS_INTERPOLATE);\n 203 | }\n 204 | if (IO.mix_green)\n 205 | {\n 206 | for (P1.colors = 3, i = 0; i < S.height * S.width; i++)\n 207 | imgdata.image[i][1] = (imgdata.image[i][1] + imgdata.image[i][3]) >> 1;\n 208 | SET_PROC_FLAG(LIBRAW_PROGRESS_MIX_GREEN);\n 209 | }\n 210 | \n 211 | if (callbacks.post_interpolate_cb)\n 212 | (callbacks.post_interpolate_cb)(this);\n 213 | else if (!P1.is_foveon && P1.colors == 3 && O.med_passes > 0)\n 214 | {\n 215 | median_filter();\n 216 | SET_PROC_FLAG(LIBRAW_PROGRESS_MEDIAN_FILTER);\n 217 | }\n 218 | \n 219 | if (O.highlight == 2)\n 220 | {\n 221 | blend_highlights();\n 222 | SET_PROC_FLAG(LIBRAW_PROGRESS_HIGHLIGHTS);\n 223 | }\n 224 | \n 225 | if (O.highlight > 2)\n 226 | {\n 227 | recover_highlights();\n 228 | SET_PROC_FLAG(LIBRAW_PROGRESS_HIGHLIGHTS);\n 229 | }\n 230 | \n 231 | if (O.use_fuji_rotate)\n 232 | {\n 233 | fuji_rotate();\n 234 | SET_PROC_FLAG(LIBRAW_PROGRESS_FUJI_ROTATE);\n 235 | }\n 236 | \n 237 | if (!libraw_internal_data.output_data.histogram)\n 238 | {\n 239 | libraw_internal_data.output_data.histogram =\n 240 | (int(*)[LIBRAW_HISTOGRAM_SIZE])calloc(1,\n 241 | sizeof(*libraw_internal_data.output_data.histogram) * 4);\n 242 | }\n 243 | #ifndef NO_LCMS\n 244 | if (O.camera_profile)\n 245 | {\n 246 | apply_profile(O.camera_profile, O.output_profile);\n 247 | SET_PROC_FLAG(LIBRAW_PROGRESS_APPLY_PROFILE);\n 248 | }\n 249 | #endif\n 250 | \n 251 | if (callbacks.pre_converttorgb_cb)\n 252 | (callbacks.pre_converttorgb_cb)(this);\n 253 | \n 254 | convert_to_rgb();\n 255 | SET_PROC_FLAG(LIBRAW_PROGRESS_CONVERT_RGB);\n 256 | \n 257 | if (callbacks.post_converttorgb_cb)\n 258 | (callbacks.post_converttorgb_cb)(this);\n 259 | \n 260 | if (O.use_fuji_rotate)\n 261 | {\n 262 | stretch();\n 263 | SET_PROC_FLAG(LIBRAW_PROGRESS_STRETCH);\n 264 | }\n 265 | O.four_color_rgb = save_4color; // also, restore\n 266 | \n 267 | return 0;\n 268 | }\n 269 | catch (const std::bad_alloc&)\n 270 | {\n 271 | recycle();\n 272 | return LIBRAW_UNSUFFICIENT_MEMORY;", "src_commits": "[{\"path\":\"/src/libraw\",\"rev\":\"f9d5f6565a36abc60e672e2db6e7ca80b6bf642e\",\"url\":\"https://github.com/libraw/libraw\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"libraw_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/libraw/src/postprocessing/dcraw_process.cpp\"]", "target_text": "Reach line at /src/libraw/src/postprocessing/dcraw_process.cpp:172 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-libraw:v2026-07-test1@sha256:faa3f5de1db16c0f6b9968ee796375be742b5d8b30f6659ad6150a347c076133", "runtime_digest": "sha256:faa3f5de1db16c0f6b9968ee796375be742b5d8b30f6659ad6150a347c076133", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "libraw:merged:src/libraw/src/metadata/identify.cpp:723", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "libraw", "harness": "merged", "harness_binaries": "[\"libraw_cr2_fuzzer\", \"libraw_fuzzer\", \"libraw_nef_fuzzer\", \"libraw_raf_fuzzer\"]", "language": "c++", "file": "/src/libraw/src/metadata/identify.cpp", "line_start": 723, "line_end": 723, "line_count": 1, "function": "", "source_snippet": " 623 | else if (!memcmp(head, \"RIFF\", 4))\n 624 | {\n 625 | fseek(ifp, 0, SEEK_SET);\n 626 | parse_riff(100);\n 627 | }\n 628 | else if (!memcmp(head + 4, \"ftypqt \", 9))\n 629 | {\n 630 | fseek(ifp, 0, SEEK_SET);\n 631 | \t// Use existing variable that definitely not used in parse_qt/parse_jpeg to avoid ABI change\n 632 | \tshort cr3save = libraw_internal_data.unpacker_data.CR3_Version;\n 633 | \tlibraw_internal_data.unpacker_data.CR3_Version = 32;\n 634 | parse_qt(fsize);\n 635 | \tlibraw_internal_data.unpacker_data.CR3_Version = cr3save;\n 636 | is_raw = 0;\n 637 | }\n 638 | else if (!memcmp(head, \"\\0\\001\\0\\001\\0@\", 6))\n 639 | {\n 640 | fseek(ifp, 6, SEEK_SET);\n 641 | fread(make, 1, 8, ifp);\n 642 | fread(model, 1, 8, ifp);\n 643 | fread(model2, 1, 16, ifp);\n 644 | data_offset = get2();\n 645 | get2();\n 646 | raw_width = get2();\n 647 | raw_height = get2();\n 648 | load_raw = &LibRaw::nokia_load_raw;\n 649 | filters = 0x61616161;\n 650 | }\n 651 | else if (!memcmp(head, \"NOKIARAW\", 8))\n 652 | {\n 653 | strcpy(make, \"NOKIA\");\n 654 | order = 0x4949;\n 655 | fseek(ifp, 300, SEEK_SET);\n 656 | data_offset = get4();\n 657 | i = get4(); // bytes count\n 658 | width = get2();\n 659 | height = get2();\n 660 | \n 661 | // Data integrity check\n 662 | if (width < 1 || width > 16000 || height < 1 || height > 16000 ||\n 663 | i < (width * height) || i > (2 * width * height))\n 664 | throw LIBRAW_EXCEPTION_IO_CORRUPT;\n 665 | \n 666 | switch (tiff_bps = i * 8 / (width * height))\n 667 | {\n 668 | case 8:\n 669 | load_raw = &LibRaw::eight_bit_load_raw;\n 670 | break;\n 671 | case 10:\n 672 | load_raw = &LibRaw::nokia_load_raw;\n 673 | break;\n 674 | case 0:\n 675 | throw LIBRAW_EXCEPTION_IO_CORRUPT;\n 676 | break;\n 677 | }\n 678 | raw_height = height + (top_margin = i / (width * tiff_bps / 8) - height);\n 679 | mask[0][3] = 1;\n 680 | filters = 0x61616161;\n 681 | }\n 682 | else if (!memcmp(head, \"DSC-Image\", 9))\n 683 | parse_rollei();\n 684 | else if (!memcmp(head, \"PWAD\", 4))\n 685 | parse_sinar_ia();\n 686 | else if (!memcmp(head, \"\\0MRM\", 4))\n 687 | parse_minolta(0);\n 688 | else if (!memcmp(head, \"FOVb\", 4))\n 689 | {\n 690 | parse_x3f(); /* Does nothing if USE_X3FTOOLS is not defined */\n 691 | }\n 692 | else if (!memcmp(head, \"CI\", 2))\n 693 | parse_cine();\n 694 | #ifdef USE_6BY9RPI\n 695 | else if (!memcmp(head, \"BRCM\", 4)) {\n 696 | \tfseek(ifp, 0, SEEK_SET);\n 697 | \tstrcpy(make, \"RaspberryPi\");\n 698 | \tstrcpy(model, \"Pi\");\n 699 | \tparse_raspberrypi();\n 700 | \t}\n 701 | #endif\n 702 | else if (!memcmp(head + 4, \"ftypcrx \", 8))\n 703 | {\n 704 | int err;\n 705 | UINT64 szAtomList;\n 706 | short nesting = -1;\n 707 | short nTrack = -1;\n 708 | short TrackType;\n 709 | char AtomNameStack[129];\n 710 | strcpy(make, \"Canon\");\n 711 | \n 712 | szAtomList = ifp->size();\n 713 | err = parseCR3(0ULL, szAtomList, nesting, AtomNameStack, nTrack, TrackType,szAtomList);\n 714 | libraw_internal_data.unpacker_data.crx_track_count = nTrack;\n 715 | if ((err == 0 || err == -14) &&\n 716 | nTrack >= 0) // no error, or too deep nesting\n 717 | selectCRXTrack();\n 718 | }\n 719 | \n 720 | if (dng_version)\n 721 | {\n 722 | if (fsize > LIBRAW_MAX_DNG_RAW_FILE_SIZE)\n> 723 | throw LIBRAW_EXCEPTION_TOOBIG;\n 724 | }\n 725 | else if (load_raw == &LibRaw::crxLoadRaw)\n 726 | {\n 727 | if (fsize > LIBRAW_MAX_CR3_RAW_FILE_SIZE)\n 728 | throw LIBRAW_EXCEPTION_TOOBIG;\n 729 | }\n 730 | else\n 731 | {\n 732 | if (fsize > LIBRAW_MAX_NONDNG_RAW_FILE_SIZE)\n 733 | throw LIBRAW_EXCEPTION_TOOBIG;\n 734 | }\n 735 | \n 736 | if (make[0] == 0)\n 737 | for (zero_fsize = i = 0; i < (int)camera_count; i++)\n 738 | if (fsize == (INT64)table[i].fsize)\n 739 | {\n 740 | strcpy(make, table[i].t_make);\n 741 | strcpy(model, table[i].t_model);\n 742 | flip = table[i].flags >> 2;\n 743 | zero_is_bad = table[i].flags & 2;\n 744 | data_offset = table[i].offset == 0xffff ? 0 : table[i].offset;\n 745 | raw_width = table[i].rw;\n 746 | raw_height = table[i].rh;\n 747 | left_margin = table[i].lm;\n 748 | top_margin = table[i].tm;\n 749 | width = raw_width - left_margin - table[i].rm;\n 750 | height = raw_height - top_margin - table[i].bm;\n 751 | filters = 0x1010101U * table[i].cf;\n 752 | colors = 4 - !((filters & filters >> 1) & 0x5555);\n 753 | load_flags = table[i].lf & 0xff;\n 754 | if (table[i].lf & 0x100) /* Monochrome sensor dump */\n 755 | {\n 756 | colors = 1;\n 757 | filters = 0;\n 758 | }\n 759 | switch (tiff_bps = unsigned((fsize - data_offset) * 8LL / (INT64(raw_width) * INT64(raw_height))))\n 760 | {\n 761 | case 6:\n 762 | load_raw = &LibRaw::minolta_rd175_load_raw;\n 763 | ilm.CameraMount = LIBRAW_MOUNT_Minolta_A;\n 764 | break;\n 765 | case 8:\n 766 | load_raw = &LibRaw::eight_bit_load_raw;\n 767 | break;\n 768 | case 10:\n 769 | if ((fsize - data_offset) / INT64(raw_height) * 3LL >= INT64(raw_width) * 4LL)\n 770 | {\n 771 | load_raw = &LibRaw::android_loose_load_raw;\n 772 | break;\n 773 | }\n 774 | else if (load_flags & 1)\n 775 | {\n 776 | load_raw = &LibRaw::android_tight_load_raw;\n 777 | break;\n 778 | }\n 779 | case 12:\n 780 | load_flags |= 128;\n 781 | load_raw = &LibRaw::packed_load_raw;\n 782 | break;\n 783 | case 16:\n 784 | order = 0x4949 | 0x404 * (load_flags & 1);\n 785 | tiff_bps -= load_flags >> 4;\n 786 | tiff_bps -= load_flags = load_flags >> 1 & 7;\n 787 | load_raw = table[i].offset == 0xffff\n 788 | ? &LibRaw::unpacked_load_raw_reversed\n 789 | : &LibRaw::unpacked_load_raw;\n 790 | }\n 791 | maximum = (1 << tiff_bps) - (1 << table[i].max);\n 792 | break;\n 793 | }\n 794 | if (zero_fsize)\n 795 | fsize = 0;\n 796 | if (make[0] == 0 && fsize < 25000000LL)\n 797 | parse_smal(0, flen);\n 798 | if (make[0] == 0)\n 799 | {\n 800 | parse_jpeg(0);\n 801 | #ifdef USE_6BY9RPI\n 802 | \tif (!(strncmp(model, \"ov\", 2) && strncmp(model, \"RP_\", 3) && strncmp(model, \"imx477\", 6))) {\n 803 | \t\t//Assume that this isn't a raw unless the header can be found\n 804 | \t\tis_raw = 0;\n 805 | \n 806 | \t\tif (!strncasecmp(model, \"RP_testc\",8) \n 807 | || !strncasecmp(model, \"imx477\", 6) // from PyDNG\n 808 | \t\t || !strncasecmp(model, \"RP_imx477\",9)) {\n 809 | \t\t\tconst long offsets[] = {\n 810 | \t\t\t\t//IMX477 offsets\n 811 | \t\t\t\t3375104, //2028x1080 12bit\n 812 | \t\t\t\t4751360, //2028x1520 12bit\n 813 | \t\t\t\t18711040, //4056x3040 12bit\n 814 | \t\t\t\t1015808, //1012x760 10bit\n 815 | \t\t\t\t-1 //Marker for end of table\n 816 | \t\t\t};\n 817 | \t\t\tint offset_idx;\n 818 | \t\t\tfor (offset_idx=0; offsets[offset_idx]!=-1; offset_idx++) {\n 819 | \t\t\t\tif(!fseek (ifp, -offsets[offset_idx], SEEK_END) &&\n 820 | \t\t\t\t fread (head, 1, 32, ifp) && !strncmp(head,\"BRCM\", 4)) {\n 821 | \t\t\t\t\tfseek(ifp, -32, SEEK_CUR);\n 822 | \t\t\t\t\tstrcpy (make, \"RaspberryPi\");\n 823 | strcpy(model, \"RP_imx477\"); // Force single model", "src_commits": "[{\"path\":\"/src/libraw\",\"rev\":\"f9d5f6565a36abc60e672e2db6e7ca80b6bf642e\",\"url\":\"https://github.com/libraw/libraw\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"libraw_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/libraw/src/metadata/identify.cpp\"]", "target_text": "Reach line at /src/libraw/src/metadata/identify.cpp:723 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-libraw:v2026-07-test1@sha256:faa3f5de1db16c0f6b9968ee796375be742b5d8b30f6659ad6150a347c076133", "runtime_digest": "sha256:faa3f5de1db16c0f6b9968ee796375be742b5d8b30f6659ad6150a347c076133", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "libraw:merged:src/libraw/src/utils/utils_libraw.cpp:334", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "libraw", "harness": "merged", "harness_binaries": "[\"libraw_cr2_fuzzer\", \"libraw_fuzzer\", \"libraw_nef_fuzzer\", \"libraw_raf_fuzzer\"]", "language": "c++", "file": "/src/libraw/src/utils/utils_libraw.cpp", "line_start": 334, "line_end": 334, "line_count": 1, "function": "", "source_snippet": " 234 | \t\t load_raw == &LibRaw::sony_ycbcr_load_raw;\n 235 | }\n 236 | int LibRaw::is_coolscan_nef()\n 237 | {\n 238 | return load_raw == &LibRaw::nikon_coolscan_load_raw;\n 239 | }\n 240 | int LibRaw::is_jpeg_thumb()\n 241 | {\n 242 | return libraw_internal_data.unpacker_data.thumb_format == LIBRAW_INTERNAL_THUMBNAIL_JPEG;\n 243 | }\n 244 | \n 245 | int LibRaw::is_nikon_sraw() { return load_raw == &LibRaw::nikon_load_sraw; }\n 246 | int LibRaw::sraw_midpoint()\n 247 | {\n 248 | if (load_raw == &LibRaw::canon_sraw_load_raw)\n 249 | return 8192;\n 250 | else if (load_raw == &LibRaw::sony_ycbcr_load_raw)\n 251 | return 8192; // adjusted as in canon sRAW\n 252 | else if (load_raw == &LibRaw::nikon_load_sraw)\n 253 | return 2048;\n 254 | else\n 255 | return 0;\n 256 | }\n 257 | \n 258 | void *LibRaw::malloc(size_t t)\n 259 | {\n 260 | void *p = memmgr.malloc(t);\n 261 | if (!p)\n 262 | throw LIBRAW_EXCEPTION_ALLOC;\n 263 | return p;\n 264 | }\n 265 | void *LibRaw::realloc(void *q, size_t t)\n 266 | {\n 267 | void *p = memmgr.realloc(q, t);\n 268 | if (!p)\n 269 | throw LIBRAW_EXCEPTION_ALLOC;\n 270 | return p;\n 271 | }\n 272 | \n 273 | void *LibRaw::calloc(size_t n, size_t t)\n 274 | {\n 275 | void *p = memmgr.calloc(n, t);\n 276 | if (!p)\n 277 | throw LIBRAW_EXCEPTION_ALLOC;\n 278 | return p;\n 279 | }\n 280 | void LibRaw::free(void *p) { memmgr.free(p); }\n 281 | \n 282 | void LibRaw::recycle_datastream()\n 283 | {\n 284 | if (libraw_internal_data.internal_data.input &&\n 285 | libraw_internal_data.internal_data.input_internal)\n 286 | {\n 287 | delete libraw_internal_data.internal_data.input;\n 288 | libraw_internal_data.internal_data.input = NULL;\n 289 | }\n 290 | libraw_internal_data.internal_data.input_internal = 0;\n 291 | }\n 292 | \n 293 | void LibRaw::clearCancelFlag()\n 294 | {\n 295 | #ifdef _MSC_VER\n 296 | InterlockedExchange(&_exitflag, 0);\n 297 | #else\n 298 | __sync_fetch_and_and(&_exitflag, 0);\n 299 | #endif\n 300 | #ifdef RAWSPEED_FASTEXIT\n 301 | if (_rawspeed_decoder)\n 302 | {\n 303 | RawSpeed::RawDecoder *d =\n 304 | static_cast(_rawspeed_decoder);\n 305 | d->resumeProcessing();\n 306 | }\n 307 | #endif\n 308 | }\n 309 | \n 310 | void LibRaw::setCancelFlag()\n 311 | {\n 312 | #ifdef _MSC_VER\n 313 | InterlockedExchange(&_exitflag, 1);\n 314 | #else\n 315 | __sync_fetch_and_add(&_exitflag, 1);\n 316 | #endif\n 317 | #ifdef RAWSPEED_FASTEXIT\n 318 | if (_rawspeed_decoder)\n 319 | {\n 320 | RawSpeed::RawDecoder *d =\n 321 | static_cast(_rawspeed_decoder);\n 322 | d->cancelProcessing();\n 323 | }\n 324 | #endif\n 325 | }\n 326 | \n 327 | void LibRaw::checkCancel()\n 328 | {\n 329 | #ifdef _MSC_VER\n 330 | if (InterlockedExchange(&_exitflag, 0))\n 331 | throw LIBRAW_EXCEPTION_CANCELLED_BY_CALLBACK;\n 332 | #else\n 333 | if (__sync_fetch_and_and(&_exitflag, 0))\n> 334 | throw LIBRAW_EXCEPTION_CANCELLED_BY_CALLBACK;\n 335 | #endif\n 336 | }\n 337 | \n 338 | int LibRaw::is_curve_linear()\n 339 | {\n 340 | for (int i = 0; i < 0x10000; i++)\n 341 | if (imgdata.color.curve[i] != i)\n 342 | return 0;\n 343 | return 1;\n 344 | }\n 345 | \n 346 | void LibRaw::free_image(void)\n 347 | {\n 348 | if (imgdata.image)\n 349 | {\n 350 | free(imgdata.image);\n 351 | imgdata.image = 0;\n 352 | imgdata.progress_flags = LIBRAW_PROGRESS_START | LIBRAW_PROGRESS_OPEN |\n 353 | LIBRAW_PROGRESS_IDENTIFY |\n 354 | LIBRAW_PROGRESS_SIZE_ADJUST |\n 355 | LIBRAW_PROGRESS_LOAD_RAW;\n 356 | }\n 357 | }\n 358 | \n 359 | int LibRaw::is_phaseone_compressed()\n 360 | {\n 361 | return (load_raw == &LibRaw::phase_one_load_raw_c ||\n 362 | \t\t load_raw == &LibRaw::phase_one_load_raw_s ||\n 363 | load_raw == &LibRaw::phase_one_load_raw);\n 364 | }\n 365 | \n 366 | int LibRaw::is_canon_600() { return load_raw == &LibRaw::canon_600_load_raw; }\n 367 | const char *LibRaw::strprogress(enum LibRaw_progress p)\n 368 | {\n 369 | switch (p)\n 370 | {\n 371 | case LIBRAW_PROGRESS_START:\n 372 | return \"Starting\";\n 373 | case LIBRAW_PROGRESS_OPEN:\n 374 | return \"Opening file\";\n 375 | case LIBRAW_PROGRESS_IDENTIFY:\n 376 | return \"Reading metadata\";\n 377 | case LIBRAW_PROGRESS_SIZE_ADJUST:\n 378 | return \"Adjusting size\";\n 379 | case LIBRAW_PROGRESS_LOAD_RAW:\n 380 | return \"Reading RAW data\";\n 381 | case LIBRAW_PROGRESS_REMOVE_ZEROES:\n 382 | return \"Clearing zero values\";\n 383 | case LIBRAW_PROGRESS_BAD_PIXELS:\n 384 | return \"Removing dead pixels\";\n 385 | case LIBRAW_PROGRESS_DARK_FRAME:\n 386 | return \"Subtracting dark frame data\";\n 387 | case LIBRAW_PROGRESS_FOVEON_INTERPOLATE:\n 388 | return \"Interpolating Foveon sensor data\";\n 389 | case LIBRAW_PROGRESS_SCALE_COLORS:\n 390 | return \"Scaling colors\";\n 391 | case LIBRAW_PROGRESS_PRE_INTERPOLATE:\n 392 | return \"Pre-interpolating\";\n 393 | case LIBRAW_PROGRESS_INTERPOLATE:\n 394 | return \"Interpolating\";\n 395 | case LIBRAW_PROGRESS_MIX_GREEN:\n 396 | return \"Mixing green channels\";\n 397 | case LIBRAW_PROGRESS_MEDIAN_FILTER:\n 398 | return \"Median filter\";\n 399 | case LIBRAW_PROGRESS_HIGHLIGHTS:\n 400 | return \"Highlight recovery\";\n 401 | case LIBRAW_PROGRESS_FUJI_ROTATE:\n 402 | return \"Rotating Fuji diagonal data\";\n 403 | case LIBRAW_PROGRESS_FLIP:\n 404 | return \"Flipping image\";\n 405 | case LIBRAW_PROGRESS_APPLY_PROFILE:\n 406 | return \"ICC conversion\";\n 407 | case LIBRAW_PROGRESS_CONVERT_RGB:\n 408 | return \"Converting to RGB\";\n 409 | case LIBRAW_PROGRESS_STRETCH:\n 410 | return \"Stretching image\";\n 411 | case LIBRAW_PROGRESS_THUMB_LOAD:\n 412 | return \"Loading thumbnail\";\n 413 | default:\n 414 | return \"Some strange things\";\n 415 | }\n 416 | }\n 417 | int LibRaw::adjust_sizes_info_only(void)\n 418 | {\n 419 | CHECK_ORDER_LOW(LIBRAW_PROGRESS_IDENTIFY);\n 420 | \n 421 | raw2image_start();\n 422 | if (O.use_fuji_rotate)\n 423 | {\n 424 | if (IO.fuji_width)\n 425 | {\n 426 | IO.fuji_width = (IO.fuji_width - 1 + IO.shrink) >> IO.shrink;\n 427 | S.iwidth = (ushort)(IO.fuji_width / sqrt(0.5));\n 428 | S.iheight = (ushort)((S.iheight - IO.fuji_width) / sqrt(0.5));\n 429 | }\n 430 | else\n 431 | {\n 432 | if (S.pixel_aspect < 0.995)\n 433 | S.iheight = (ushort)(S.iheight / S.pixel_aspect + 0.5);\n 434 | if (S.pixel_aspect > 1.005)", "src_commits": "[{\"path\":\"/src/libraw\",\"rev\":\"f9d5f6565a36abc60e672e2db6e7ca80b6bf642e\",\"url\":\"https://github.com/libraw/libraw\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"libraw_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/libraw/src/utils/utils_libraw.cpp\"]", "target_text": "Reach line at /src/libraw/src/utils/utils_libraw.cpp:334 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-libraw:v2026-07-test1@sha256:faa3f5de1db16c0f6b9968ee796375be742b5d8b30f6659ad6150a347c076133", "runtime_digest": "sha256:faa3f5de1db16c0f6b9968ee796375be742b5d8b30f6659ad6150a347c076133", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "libraw:merged:src/libraw/src/metadata/makernotes.cpp:562", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "libraw", "harness": "merged", "harness_binaries": "[\"libraw_cr2_fuzzer\", \"libraw_fuzzer\", \"libraw_nef_fuzzer\", \"libraw_raf_fuzzer\"]", "language": "c++", "file": "/src/libraw/src/metadata/makernotes.cpp", "line_start": 562, "line_end": 562, "line_count": 1, "function": "", "source_snippet": " 462 | !strcmp(buf, \"PENTAX \"))\n 463 | {\n 464 | base = ftell(ifp) - 10;\n 465 | fseek(ifp, -2, SEEK_CUR);\n 466 | \tif (buf[1] == 'M')\n 467 | \t\tget4();\n 468 | order = get2();\n 469 | if (buf[0] == 'O')\n 470 | get2();\n 471 | }\n 472 | else if (!strncmp(buf, \"SONY\", 4) || // DSLR-A100\n 473 | !strcmp(buf, \"Panasonic\")) {\n 474 | if (buf[0] == 'S')\n 475 | is_Sony = 1;\n 476 | goto nf;\n 477 | }\n 478 | else if (!strncmp(buf, \"FUJIFILM\", 8))\n 479 | {\n 480 | base = ftell(ifp) - 10;\n 481 | nf:\n 482 | order = 0x4949;\n 483 | fseek(ifp, 2, SEEK_CUR);\n 484 | }\n 485 | else if (!strcmp (buf, \"OLYMP\") ||\n 486 | !strncmp(buf, \"LEICA\", 5) ||\n 487 | !strcmp (buf, \"Ricoh\"))\n 488 | {\n 489 | fseek(ifp, -2, SEEK_CUR);\n 490 | }\n 491 | else if (!strcmp(buf, \"AOC\") || // Pentax, tribute to Asahi Optical Co.\n 492 | !strcmp(buf, \"QVC\")) // Casio, from \"QV-Camera\"\n 493 | {\n 494 | fseek(ifp, -4, SEEK_CUR);\n 495 | }\n 496 | else if (!strncmp(buf, \"CMT3\", 4))\n 497 | {\n 498 | order = sget2((uchar *)(buf + 4));\n 499 | fseek(ifp, 2L, SEEK_CUR);\n 500 | }\n 501 | else if (libraw_internal_data.unpacker_data.CR3_CTMDtag)\n 502 | {\n 503 | order = sget2((uchar *)buf);\n 504 | fseek(ifp, -2L, SEEK_CUR);\n 505 | }\n 506 | else\n 507 | {\n 508 | fseek(ifp, -10, SEEK_CUR);\n 509 | if (!strncmp(make, \"SAMSUNG\", 7))\n 510 | base = ftell(ifp);\n 511 | }\n 512 | \n 513 | if (!is_Olympus &&\n 514 | (!strncasecmp(make, \"Olympus\", 7) || !strncmp(make, \"OM Digi\", 7) ||\n 515 | (!strncasecmp(make, \"CLAUSS\", 6) && !strncasecmp(model, \"piX 5oo\", 7)))) {\n 516 | is_Olympus = 1;\n 517 | }\n 518 | \n 519 | if (!is_Sony &&\n 520 | (!strncasecmp(make, \"SONY\", 4) ||\n 521 | !strncasecmp(make, \"Konica\", 6) ||\n 522 | !strncasecmp(make, \"Minolta\", 7) ||\n 523 | (!strncasecmp(make, \"Hasselblad\", 10) &&\n 524 | (!strncasecmp(model, \"Stellar\", 7) ||\n 525 | !strncasecmp(model, \"Lunar\", 5) ||\n 526 | !strncasecmp(model, \"Lusso\", 5) ||\n 527 | !strncasecmp(model, \"HV\", 2))))) {\n 528 | is_Sony = 1;\n 529 | }\n 530 | \n 531 | if (strcasestr(make, \"Kodak\") &&\n 532 | (sget2((uchar *)buf) > 1) && // check number of entries\n 533 | (sget2((uchar *)buf) < 128) &&\n 534 | (sget2((uchar *)(buf + 4)) > 0) && // check type\n 535 | (sget2((uchar *)(buf + 4)) < 13) &&\n 536 | (sget4((uchar *)(buf + 6)) < 256) // check count\n 537 | )\n 538 | imKodak.MakerNoteKodak8a = 1; // Kodak P712 / P850 / P880\n 539 | \n 540 | entries = get2();\n 541 | if (entries > 1000)\n 542 | return;\n 543 | \n 544 | morder = order;\n 545 | while (entries--)\n 546 | {\n 547 | order = morder;\n 548 | tiff_get(base, &tag, &type, &len, &save);\n 549 | tag |= uptag << 16;\n 550 | \n 551 | INT64 _pos = ftell(ifp);\n 552 | if (len > 100 * 1024 * 1024)\n 553 | \tgoto next; // 100Mb tag? No!\n 554 | if (len > 8 && _pos + len > 2 * fsize)\n 555 | {\n 556 | fseek(ifp, save, SEEK_SET); // Recover tiff-read position!!\n 557 | continue;\n 558 | }\n 559 | \n 560 | \tif (callbacks.makernotes_cb)\n 561 | {\n> 562 | INT64 _savepos = ifp->tell();\n 563 | callbacks.makernotes_cb(callbacks.makernotesparser_data, tag, type, len, order, ifp, base);\n 564 | fseek(ifp, _savepos, SEEK_SET);\n 565 | }\n 566 | \n 567 | if (imKodak.MakerNoteKodak8a)\n 568 | {\n 569 | if ((tag == 0xff00) && tagtypeIs(LIBRAW_EXIFTAG_TYPE_LONG) && (len == 1))\n 570 | {\n 571 | INT64 _pos1 = get4();\n 572 | if ((_pos1 < fsize) && (_pos1 > 0))\n 573 | {\n 574 | fseek(ifp, _pos1, SEEK_SET);\n 575 | parse_makernote(base, tag);\n 576 | }\n 577 | }\n 578 | else if (tag == 0xff00f90b)\n 579 | {\n 580 | imKodak.clipBlack = get2();\n 581 | }\n 582 | else if (tag == 0xff00f90c)\n 583 | {\n 584 | imKodak.clipWhite = imgdata.color.linear_max[0] =\n 585 | imgdata.color.linear_max[1] = imgdata.color.linear_max[2] =\n 586 | imgdata.color.linear_max[3] = get2();\n 587 | }\n 588 | }\n 589 | else if (!strncmp(make, \"Canon\", 5))\n 590 | {\n 591 | if (tag == 0x000d && len < 256000) // camera info\n 592 | {\n 593 | if (!tagtypeIs(LIBRAW_EXIFTAG_TYPE_LONG))\n 594 | {\n 595 | CanonCameraInfo = (uchar *)calloc(MAX(16, len)+1,1);\n 596 | fread(CanonCameraInfo, len, 1, ifp);\n 597 | }\n 598 | else\n 599 | {\n 600 | CanonCameraInfo = (uchar *)calloc(MAX(16, len * 4)+1,1);\n 601 | fread(CanonCameraInfo, len, 4, ifp);\n 602 | }\n 603 | lenCanonCameraInfo = len;\n 604 | typeCanonCameraInfo = type;\n 605 | }\n 606 | \n 607 | else if (tag == 0x0010) // Canon ModelID\n 608 | {\n 609 | unique_id = get4();\n 610 | setCanonBodyFeatures(unique_id);\n 611 | if (lenCanonCameraInfo)\n 612 | {\n 613 | processCanonCameraInfo(unique_id, CanonCameraInfo, lenCanonCameraInfo,\n 614 | typeCanonCameraInfo, nonDNG);\n 615 | \t if(CanonCameraInfo)\n 616 | free(CanonCameraInfo);\n 617 | CanonCameraInfo = 0;\n 618 | lenCanonCameraInfo = 0;\n 619 | }\n 620 | }\n 621 | \n 622 | else\n 623 | parseCanonMakernotes(tag, type, len, nonDNG);\n 624 | }\n 625 | \n 626 | else if (!strncmp(make, \"FUJI\", 4))\n 627 | parseFujiMakernotes(tag, type, len, nonDNG);\n 628 | \n 629 | else if (!strncasecmp(model, \"Hasselblad X1D\", 14) ||\n 630 | !strncasecmp(model, \"Hasselblad H6D\", 14) ||\n 631 | !strncasecmp(model, \"Hasselblad A6D\", 14))\n 632 | {\n 633 | if (tag == 0x0045)\n 634 | {\n 635 | imHassy.BaseISO = get4();\n 636 | }\n 637 | else if (tag == 0x0046)\n 638 | {\n 639 | imHassy.Gain = getreal(type);\n 640 | }\n 641 | }\n 642 | \n 643 | else if (!strncmp(make, \"PENTAX\", 6) ||\n 644 | !strncmp(make, \"RICOH\", 5) ||\n 645 | !strncmp(model, \"PENTAX\", 6))\n 646 | {\n 647 | if (!strncmp(model, \"GR\", 2) ||\n 648 | !strncmp(model, \"GXR\", 3))\n 649 | {\n 650 | parseRicohMakernotes(base, tag, type, len, CameraDNG);\n 651 | }\n 652 | else\n 653 | {\n 654 | parsePentaxMakernotes(base, tag, type, len, nonDNG);\n 655 | }\n 656 | }\n 657 | \n 658 | else if (!strncmp(make, \"SAMSUNG\", 7))\n 659 | {\n 660 | if (!dng_version)\n 661 | parseSamsungMakernotes(base, tag, type, len, nonDNG);\n 662 | else", "src_commits": "[{\"path\":\"/src/libraw\",\"rev\":\"f9d5f6565a36abc60e672e2db6e7ca80b6bf642e\",\"url\":\"https://github.com/libraw/libraw\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"libraw_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/libraw/src/metadata/makernotes.cpp\"]", "target_text": "Reach line at /src/libraw/src/metadata/makernotes.cpp:562 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-libraw:v2026-07-test1@sha256:faa3f5de1db16c0f6b9968ee796375be742b5d8b30f6659ad6150a347c076133", "runtime_digest": "sha256:faa3f5de1db16c0f6b9968ee796375be742b5d8b30f6659ad6150a347c076133", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "rdkit:merged:src/rdkit/Code/GraphMol/ROMol.cpp:637", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "rdkit", "harness": "merged", "harness_binaries": "[\"mol_data_stream_to_mol_fuzzer\", \"mol_deserialization_fuzzer\", \"smiles_string_to_mol_fuzzer\"]", "language": "c++", "file": "/src/rdkit/Code/GraphMol/ROMol.cpp", "line_start": 637, "line_end": 637, "line_count": 1, "function": "", "source_snippet": " 537 | \n 538 | bool ROMol::hasQuery() const {\n 539 | for (auto atom : atoms()) {\n 540 | if (atom->hasQuery()) {\n 541 | return true;\n 542 | }\n 543 | }\n 544 | for (auto bond : bonds()) {\n 545 | if (bond->hasQuery()) {\n 546 | return true;\n 547 | }\n 548 | }\n 549 | return false;\n 550 | }\n 551 | \n 552 | ROMol::QueryAtomIterator ROMol::beginQueryAtoms(QueryAtom const *what) {\n 553 | return QueryAtomIterator(this, what);\n 554 | }\n 555 | ROMol::ConstQueryAtomIterator ROMol::beginQueryAtoms(\n 556 | QueryAtom const *what) const {\n 557 | return ConstQueryAtomIterator(this, what);\n 558 | }\n 559 | ROMol::QueryAtomIterator ROMol::endQueryAtoms() {\n 560 | return QueryAtomIterator(this, getNumAtoms());\n 561 | }\n 562 | ROMol::ConstQueryAtomIterator ROMol::endQueryAtoms() const {\n 563 | return ConstQueryAtomIterator(this, getNumAtoms());\n 564 | }\n 565 | ROMol::MatchingAtomIterator ROMol::beginMatchingAtoms(bool (*what)(Atom *)) {\n 566 | return MatchingAtomIterator(this, what);\n 567 | }\n 568 | ROMol::ConstMatchingAtomIterator ROMol::beginMatchingAtoms(\n 569 | bool (*what)(const Atom *)) const {\n 570 | return ConstMatchingAtomIterator(this, what);\n 571 | }\n 572 | ROMol::MatchingAtomIterator ROMol::endMatchingAtoms() {\n 573 | return MatchingAtomIterator(this, getNumAtoms());\n 574 | }\n 575 | ROMol::ConstMatchingAtomIterator ROMol::endMatchingAtoms() const {\n 576 | return ConstMatchingAtomIterator(this, getNumAtoms());\n 577 | }\n 578 | \n 579 | ROMol::BondIterator ROMol::beginBonds() { return BondIterator(this); }\n 580 | ROMol::ConstBondIterator ROMol::beginBonds() const {\n 581 | return ConstBondIterator(this);\n 582 | }\n 583 | ROMol::BondIterator ROMol::endBonds() {\n 584 | auto [beg, end] = getEdges();\n 585 | return BondIterator(this, end);\n 586 | }\n 587 | ROMol::ConstBondIterator ROMol::endBonds() const {\n 588 | auto [beg, end] = getEdges();\n 589 | return ConstBondIterator(this, end);\n 590 | }\n 591 | \n 592 | void ROMol::clearComputedProps(bool includeRings) const {\n 593 | // the SSSR information:\n 594 | if (includeRings) {\n 595 | this->dp_ringInfo->reset();\n 596 | }\n 597 | \n 598 | RDProps::clearComputedProps();\n 599 | \n 600 | for (auto atom : atoms()) {\n 601 | atom->clearComputedProps();\n 602 | }\n 603 | \n 604 | for (auto bond : bonds()) {\n 605 | bond->clearComputedProps();\n 606 | }\n 607 | }\n 608 | \n 609 | void ROMol::updatePropertyCache(bool strict) {\n 610 | for (auto atom : atoms()) {\n 611 | atom->updatePropertyCache(strict);\n 612 | }\n 613 | for (auto bond : bonds()) {\n 614 | bond->updatePropertyCache(strict);\n 615 | }\n 616 | }\n 617 | \n 618 | bool ROMol::needsUpdatePropertyCache() const {\n 619 | for (const auto atom : atoms()) {\n 620 | if (atom->needsUpdatePropertyCache()) {\n 621 | return true;\n 622 | }\n 623 | }\n 624 | // there is no test for bonds yet since they do not obtain a valence property\n 625 | return false;\n 626 | }\n 627 | \n 628 | void ROMol::clearPropertyCache() {\n 629 | for (auto atom : atoms()) {\n 630 | atom->clearPropertyCache();\n 631 | }\n 632 | }\n 633 | \n 634 | const Conformer &ROMol::getConformer(int id) const {\n 635 | // make sure we have more than one conformation\n 636 | if (d_confs.size() == 0) {\n> 637 | throw ConformerException(\"No conformations available on the molecule\");\n 638 | }\n 639 | \n 640 | if (id < 0) {\n 641 | return *(d_confs.front());\n 642 | }\n 643 | auto cid = (unsigned int)id;\n 644 | for (auto conf : d_confs) {\n 645 | if (conf->getId() == cid) {\n 646 | return *conf;\n 647 | }\n 648 | }\n 649 | // we did not find a conformation with the specified ID\n 650 | std::string mesg = \"Can't find conformation with ID: \";\n 651 | mesg += id;\n 652 | throw ConformerException(mesg);\n 653 | }\n 654 | \n 655 | Conformer &ROMol::getConformer(int id) {\n 656 | return const_cast(\n 657 | static_cast(this)->getConformer(id));\n 658 | }\n 659 | \n 660 | void ROMol::removeConformer(unsigned int id) {\n 661 | for (auto ci = d_confs.begin(); ci != d_confs.end(); ++ci) {\n 662 | if ((*ci)->getId() == id) {\n 663 | d_confs.erase(ci);\n 664 | return;\n 665 | }\n 666 | }\n 667 | }\n 668 | \n 669 | unsigned int ROMol::addConformer(Conformer *conf, bool assignId) {\n 670 | PRECONDITION(conf, \"bad conformer\");\n 671 | PRECONDITION(conf->getNumAtoms() == this->getNumAtoms(),\n 672 | \"Number of atom mismatch\");\n 673 | if (assignId) {\n 674 | int maxId = -1;\n 675 | for (auto cptr : d_confs) {\n 676 | maxId = std::max((int)(cptr->getId()), maxId);\n 677 | }\n 678 | maxId++;\n 679 | conf->setId((unsigned int)maxId);\n 680 | }\n 681 | conf->setOwningMol(this);\n 682 | CONFORMER_SPTR nConf(conf);\n 683 | d_confs.push_back(nConf);\n 684 | return conf->getId();\n 685 | }\n 686 | \n 687 | #ifdef RDK_USE_BOOST_SERIALIZATION\n 688 | template \n 689 | void ROMol::save(Archive &ar, const unsigned int) const {\n 690 | std::string pkl;\n 691 | MolPickler::pickleMol(*this, pkl, PicklerOps::AllProps);\n 692 | ar << pkl;\n 693 | }\n 694 | \n 695 | template \n 696 | void ROMol::load(Archive &ar, const unsigned int) {\n 697 | std::string pkl;\n 698 | ar >> pkl;\n 699 | \n 700 | delete dp_ringInfo;\n 701 | initMol();\n 702 | \n 703 | numBonds = 0;\n 704 | MolPickler::molFromPickle(pkl, *this, PicklerOps::AllProps);\n 705 | numBonds = rdcast(boost::num_edges(d_graph));\n 706 | }\n 707 | \n 708 | template RDKIT_GRAPHMOL_EXPORT void ROMol::save(\n 709 | boost::archive::text_oarchive &, const unsigned int) const;\n 710 | template RDKIT_GRAPHMOL_EXPORT void ROMol::load(\n 711 | boost::archive::text_iarchive &, const unsigned int);\n 712 | #endif\n 713 | \n 714 | } // namespace RDKit", "src_commits": "[{\"path\":\"/src/eigen\",\"rev\":\"2cf9891537250255f50df5109ffe9e700e2a73de\",\"url\":\"https://gitlab.com/libeigen/eigen\"},{\"path\":\"/src/rdkit\",\"rev\":\"232e4ffc84de1983918e6422fbec47d5da74db25\",\"url\":\"https://github.com/rdkit/rdkit.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"smiles_string_to_mol_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/rdkit/Code/GraphMol/ROMol.cpp\"]", "target_text": "Reach line at /src/rdkit/Code/GraphMol/ROMol.cpp:637 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-rdkit:v2026-07-test1@sha256:3361dd349cc9e92dfe48e664b1c0fe61eeadf62cc08834e8f9ae28187f283320", "runtime_digest": "sha256:3361dd349cc9e92dfe48e664b1c0fe61eeadf62cc08834e8f9ae28187f283320", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "rdkit:merged:src/rdkit/Code/RDGeneral/Dict.h:355", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "rdkit", "harness": "merged", "harness_binaries": "[\"mol_data_stream_to_mol_fuzzer\", \"mol_deserialization_fuzzer\", \"smiles_string_to_mol_fuzzer\"]", "language": "c++", "file": "/src/rdkit/Code/RDGeneral/Dict.h", "line_start": 355, "line_end": 355, "line_count": 1, "function": "", "source_snippet": " 255 | template \n 256 | bool getValIfPresent(const std::string_view what, T &res) const {\n 257 | for (const auto &data : _data) {\n 258 | if (data.key == what) {\n 259 | res = from_rdvalue(data.val);\n 260 | return true;\n 261 | }\n 262 | }\n 263 | return false;\n 264 | }\n 265 | \n 266 | //! \\overload\n 267 | bool getValIfPresent(const std::string_view what, std::string &res) const {\n 268 | for (const auto &i : _data) {\n 269 | if (i.key == what) {\n 270 | rdvalue_tostring(i.val, res);\n 271 | return true;\n 272 | }\n 273 | }\n 274 | return false;\n 275 | }\n 276 | \n 277 | //----------------------------------------------------------\n 278 | //! \\brief Sets the value associated with a key\n 279 | /*!\n 280 | \n 281 | \\param what the key to set\n 282 | \\param val the value to store\n 283 | \n 284 | Notes:\n 285 | - If \\c val is a const char *, it will be converted\n 286 | to a \\c std::string for storage.\n 287 | - If the dictionary already contains the key \\c what,\n 288 | the value will be replaced.\n 289 | */\n 290 | template \n 291 | void setVal(const std::string_view what, T &val) {\n 292 | static_assert(!std::is_same_v,\n 293 | \"T cannot be string_view\");\n 294 | if (what.empty()) {\n 295 | throw ValueErrorException(\"Cannot set value with empty key\");\n 296 | }\n 297 | _hasNonPodData = true;\n 298 | for (auto &&data : _data) {\n 299 | if (data.key == what) {\n 300 | RDValue::cleanup_rdvalue(data.val);\n 301 | data.val = val;\n 302 | return;\n 303 | }\n 304 | }\n 305 | _data.push_back(Pair(what, val));\n 306 | }\n 307 | \n 308 | template \n 309 | void setPODVal(const std::string_view what, T val) {\n 310 | static_assert(!std::is_same_v,\n 311 | \"T cannot be string_view\");\n 312 | if (what.empty()) {\n 313 | throw ValueErrorException(\"Cannot set value with empty key\");\n 314 | }\n 315 | // don't change the hasNonPodData status\n 316 | for (auto &&data : _data) {\n 317 | if (data.key == what) {\n 318 | RDValue::cleanup_rdvalue(data.val);\n 319 | data.val = val;\n 320 | return;\n 321 | }\n 322 | }\n 323 | _data.push_back(Pair(what, val));\n 324 | }\n 325 | \n 326 | void setVal(const std::string_view what, bool val) {\n 327 | if (what.empty()) {\n 328 | throw ValueErrorException(\"Cannot set value with empty key\");\n 329 | }\n 330 | setPODVal(what, val);\n 331 | }\n 332 | \n 333 | void setVal(const std::string_view what, double val) {\n 334 | if (what.empty()) {\n 335 | throw ValueErrorException(\"Cannot set value with empty key\");\n 336 | }\n 337 | setPODVal(what, val);\n 338 | }\n 339 | \n 340 | void setVal(const std::string_view what, float val) {\n 341 | if (what.empty()) {\n 342 | throw ValueErrorException(\"Cannot set value with empty key\");\n 343 | }\n 344 | setPODVal(what, val);\n 345 | }\n 346 | void setVal(const std::string_view what, int val) {\n 347 | if (what.empty()) {\n 348 | throw ValueErrorException(\"Cannot set value with empty key\");\n 349 | }\n 350 | setPODVal(what, val);\n 351 | }\n 352 | \n 353 | void setVal(const std::string_view what, unsigned int val) {\n 354 | if (what.empty()) {\n> 355 | throw ValueErrorException(\"Cannot set value with empty key\");\n 356 | }\n 357 | setPODVal(what, val);\n 358 | }\n 359 | \n 360 | //! \\overload\n 361 | void setVal(const std::string_view what, const char *val) {\n 362 | if (what.empty()) {\n 363 | throw ValueErrorException(\"Cannot set value with empty key\");\n 364 | }\n 365 | std::string h(val);\n 366 | setVal(what, h);\n 367 | }\n 368 | \n 369 | //----------------------------------------------------------\n 370 | //! \\brief Clears the value associated with a particular key,\n 371 | //! removing the key from the dictionary.\n 372 | /*!\n 373 | \n 374 | \\param what the key to clear\n 375 | \n 376 | */\n 377 | void clearVal(const std::string_view what) {\n 378 | for (auto it = _data.begin(); it < _data.end(); ++it) {\n 379 | if (it->key == what) {\n 380 | if (_hasNonPodData) {\n 381 | RDValue::cleanup_rdvalue(it->val);\n 382 | }\n 383 | _data.erase(it);\n 384 | return;\n 385 | }\n 386 | }\n 387 | }\n 388 | \n 389 | //----------------------------------------------------------\n 390 | //! \\brief Clears all keys (and values) from the dictionary.\n 391 | //!\n 392 | void reset() {\n 393 | if (_hasNonPodData) {\n 394 | for (auto &&data : _data) {\n 395 | RDValue::cleanup_rdvalue(data.val);\n 396 | }\n 397 | }\n 398 | DataType data;\n 399 | _data.swap(data);\n 400 | }\n 401 | \n 402 | private:\n 403 | DataType _data{}; //!< the actual dictionary\n 404 | bool _hasNonPodData{false}; // if true, need a deep copy\n 405 | // (copy_rdvalue)\n 406 | };\n 407 | \n 408 | template <>\n 409 | inline std::string Dict::getVal(\n 410 | const std::string_view what) const {\n 411 | std::string res;\n 412 | getVal(what, res);\n 413 | return res;\n 414 | }\n 415 | \n 416 | // Utility class for holding a Dict::Pair\n 417 | // Dict::Pairs require containers for memory management\n 418 | // This utility class covers cleanup and copying\n 419 | class PairHolder : public Dict::Pair {\n 420 | public:\n 421 | PairHolder() : Pair() {}\n 422 | \n 423 | explicit PairHolder(const PairHolder &p) : Pair(p.key) {\n 424 | copy_rdvalue(this->val, p.val);\n 425 | }\n 426 | \n 427 | explicit PairHolder(PairHolder &&p) : Pair(p.key) {\n 428 | this->val = p.val;\n 429 | p.val.type = RDTypeTag::EmptyTag;\n 430 | }\n 431 | \n 432 | explicit PairHolder(Dict::Pair &&p) : Pair(p.key) {\n 433 | this->val = p.val;\n 434 | p.val.type = RDTypeTag::EmptyTag;\n 435 | }\n 436 | \n 437 | ~PairHolder() { RDValue::cleanup_rdvalue(this->val); }\n 438 | };\n 439 | } // namespace RDKit\n 440 | #endif", "src_commits": "[{\"path\":\"/src/eigen\",\"rev\":\"2cf9891537250255f50df5109ffe9e700e2a73de\",\"url\":\"https://gitlab.com/libeigen/eigen\"},{\"path\":\"/src/rdkit\",\"rev\":\"232e4ffc84de1983918e6422fbec47d5da74db25\",\"url\":\"https://github.com/rdkit/rdkit.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"smiles_string_to_mol_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/rdkit/Code/RDGeneral/Dict.h\"]", "target_text": "Reach line at /src/rdkit/Code/RDGeneral/Dict.h:355 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-rdkit:v2026-07-test1@sha256:3361dd349cc9e92dfe48e664b1c0fe61eeadf62cc08834e8f9ae28187f283320", "runtime_digest": "sha256:3361dd349cc9e92dfe48e664b1c0fe61eeadf62cc08834e8f9ae28187f283320", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "rdkit:merged:src/rdkit/Code/RDGeneral/Dict.h:328", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "rdkit", "harness": "merged", "harness_binaries": "[\"mol_data_stream_to_mol_fuzzer\", \"mol_deserialization_fuzzer\", \"smiles_string_to_mol_fuzzer\"]", "language": "c++", "file": "/src/rdkit/Code/RDGeneral/Dict.h", "line_start": 328, "line_end": 328, "line_count": 1, "function": "", "source_snippet": " 228 | }\n 229 | \n 230 | //! \\overload\n 231 | void getVal(const std::string_view what, std::string &res) const {\n 232 | for (const auto &i : _data) {\n 233 | if (i.key == what) {\n 234 | rdvalue_tostring(i.val, res);\n 235 | return;\n 236 | }\n 237 | }\n 238 | throw KeyErrorException(what);\n 239 | }\n 240 | \n 241 | //----------------------------------------------------------\n 242 | //! \\brief Potentially gets the value associated with a particular key\n 243 | //! returns true on success/false on failure.\n 244 | /*!\n 245 | \\param what the key to lookup\n 246 | \\param res a reference used to return the result\n 247 | \n 248 | Notes:\n 249 | - If \\c res is a \\c std::string, every effort will be made\n 250 | to convert the specified element to a string using the\n 251 | \\c boost::lexical_cast machinery.\n 252 | - If the dictionary does not contain the key \\c what,\n 253 | a KeyErrorException will be thrown.\n 254 | */\n 255 | template \n 256 | bool getValIfPresent(const std::string_view what, T &res) const {\n 257 | for (const auto &data : _data) {\n 258 | if (data.key == what) {\n 259 | res = from_rdvalue(data.val);\n 260 | return true;\n 261 | }\n 262 | }\n 263 | return false;\n 264 | }\n 265 | \n 266 | //! \\overload\n 267 | bool getValIfPresent(const std::string_view what, std::string &res) const {\n 268 | for (const auto &i : _data) {\n 269 | if (i.key == what) {\n 270 | rdvalue_tostring(i.val, res);\n 271 | return true;\n 272 | }\n 273 | }\n 274 | return false;\n 275 | }\n 276 | \n 277 | //----------------------------------------------------------\n 278 | //! \\brief Sets the value associated with a key\n 279 | /*!\n 280 | \n 281 | \\param what the key to set\n 282 | \\param val the value to store\n 283 | \n 284 | Notes:\n 285 | - If \\c val is a const char *, it will be converted\n 286 | to a \\c std::string for storage.\n 287 | - If the dictionary already contains the key \\c what,\n 288 | the value will be replaced.\n 289 | */\n 290 | template \n 291 | void setVal(const std::string_view what, T &val) {\n 292 | static_assert(!std::is_same_v,\n 293 | \"T cannot be string_view\");\n 294 | if (what.empty()) {\n 295 | throw ValueErrorException(\"Cannot set value with empty key\");\n 296 | }\n 297 | _hasNonPodData = true;\n 298 | for (auto &&data : _data) {\n 299 | if (data.key == what) {\n 300 | RDValue::cleanup_rdvalue(data.val);\n 301 | data.val = val;\n 302 | return;\n 303 | }\n 304 | }\n 305 | _data.push_back(Pair(what, val));\n 306 | }\n 307 | \n 308 | template \n 309 | void setPODVal(const std::string_view what, T val) {\n 310 | static_assert(!std::is_same_v,\n 311 | \"T cannot be string_view\");\n 312 | if (what.empty()) {\n 313 | throw ValueErrorException(\"Cannot set value with empty key\");\n 314 | }\n 315 | // don't change the hasNonPodData status\n 316 | for (auto &&data : _data) {\n 317 | if (data.key == what) {\n 318 | RDValue::cleanup_rdvalue(data.val);\n 319 | data.val = val;\n 320 | return;\n 321 | }\n 322 | }\n 323 | _data.push_back(Pair(what, val));\n 324 | }\n 325 | \n 326 | void setVal(const std::string_view what, bool val) {\n 327 | if (what.empty()) {\n> 328 | throw ValueErrorException(\"Cannot set value with empty key\");\n 329 | }\n 330 | setPODVal(what, val);\n 331 | }\n 332 | \n 333 | void setVal(const std::string_view what, double val) {\n 334 | if (what.empty()) {\n 335 | throw ValueErrorException(\"Cannot set value with empty key\");\n 336 | }\n 337 | setPODVal(what, val);\n 338 | }\n 339 | \n 340 | void setVal(const std::string_view what, float val) {\n 341 | if (what.empty()) {\n 342 | throw ValueErrorException(\"Cannot set value with empty key\");\n 343 | }\n 344 | setPODVal(what, val);\n 345 | }\n 346 | void setVal(const std::string_view what, int val) {\n 347 | if (what.empty()) {\n 348 | throw ValueErrorException(\"Cannot set value with empty key\");\n 349 | }\n 350 | setPODVal(what, val);\n 351 | }\n 352 | \n 353 | void setVal(const std::string_view what, unsigned int val) {\n 354 | if (what.empty()) {\n 355 | throw ValueErrorException(\"Cannot set value with empty key\");\n 356 | }\n 357 | setPODVal(what, val);\n 358 | }\n 359 | \n 360 | //! \\overload\n 361 | void setVal(const std::string_view what, const char *val) {\n 362 | if (what.empty()) {\n 363 | throw ValueErrorException(\"Cannot set value with empty key\");\n 364 | }\n 365 | std::string h(val);\n 366 | setVal(what, h);\n 367 | }\n 368 | \n 369 | //----------------------------------------------------------\n 370 | //! \\brief Clears the value associated with a particular key,\n 371 | //! removing the key from the dictionary.\n 372 | /*!\n 373 | \n 374 | \\param what the key to clear\n 375 | \n 376 | */\n 377 | void clearVal(const std::string_view what) {\n 378 | for (auto it = _data.begin(); it < _data.end(); ++it) {\n 379 | if (it->key == what) {\n 380 | if (_hasNonPodData) {\n 381 | RDValue::cleanup_rdvalue(it->val);\n 382 | }\n 383 | _data.erase(it);\n 384 | return;\n 385 | }\n 386 | }\n 387 | }\n 388 | \n 389 | //----------------------------------------------------------\n 390 | //! \\brief Clears all keys (and values) from the dictionary.\n 391 | //!\n 392 | void reset() {\n 393 | if (_hasNonPodData) {\n 394 | for (auto &&data : _data) {\n 395 | RDValue::cleanup_rdvalue(data.val);\n 396 | }\n 397 | }\n 398 | DataType data;\n 399 | _data.swap(data);\n 400 | }\n 401 | \n 402 | private:\n 403 | DataType _data{}; //!< the actual dictionary\n 404 | bool _hasNonPodData{false}; // if true, need a deep copy\n 405 | // (copy_rdvalue)\n 406 | };\n 407 | \n 408 | template <>\n 409 | inline std::string Dict::getVal(\n 410 | const std::string_view what) const {\n 411 | std::string res;\n 412 | getVal(what, res);\n 413 | return res;\n 414 | }\n 415 | \n 416 | // Utility class for holding a Dict::Pair\n 417 | // Dict::Pairs require containers for memory management\n 418 | // This utility class covers cleanup and copying\n 419 | class PairHolder : public Dict::Pair {\n 420 | public:\n 421 | PairHolder() : Pair() {}\n 422 | \n 423 | explicit PairHolder(const PairHolder &p) : Pair(p.key) {\n 424 | copy_rdvalue(this->val, p.val);\n 425 | }\n 426 | \n 427 | explicit PairHolder(PairHolder &&p) : Pair(p.key) {\n 428 | this->val = p.val;", "src_commits": "[{\"path\":\"/src/eigen\",\"rev\":\"2cf9891537250255f50df5109ffe9e700e2a73de\",\"url\":\"https://gitlab.com/libeigen/eigen\"},{\"path\":\"/src/rdkit\",\"rev\":\"232e4ffc84de1983918e6422fbec47d5da74db25\",\"url\":\"https://github.com/rdkit/rdkit.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"smiles_string_to_mol_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/rdkit/Code/RDGeneral/Dict.h\"]", "target_text": "Reach line at /src/rdkit/Code/RDGeneral/Dict.h:328 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-rdkit:v2026-07-test1@sha256:3361dd349cc9e92dfe48e664b1c0fe61eeadf62cc08834e8f9ae28187f283320", "runtime_digest": "sha256:3361dd349cc9e92dfe48e664b1c0fe61eeadf62cc08834e8f9ae28187f283320", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "rdkit:merged:src/rdkit/Code/GraphMol/new_canon.h:248", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "rdkit", "harness": "merged", "harness_binaries": "[\"mol_data_stream_to_mol_fuzzer\", \"mol_deserialization_fuzzer\", \"smiles_string_to_mol_fuzzer\"]", "language": "c++", "file": "/src/rdkit/Code/GraphMol/new_canon.h", "line_start": 248, "line_end": 248, "line_count": 1, "function": "", "source_snippet": " 148 | dp_atomsInPlay(atomsInPlay),\n 149 | dp_bondsInPlay(bondsInPlay) {}\n 150 | int operator()(int i, int j) const {\n 151 | PRECONDITION(dp_atoms, \"no atoms\");\n 152 | PRECONDITION(dp_mol, \"no molecule\");\n 153 | PRECONDITION(i != j, \"bad call\");\n 154 | if (dp_atomsInPlay && !((*dp_atomsInPlay)[i] || (*dp_atomsInPlay)[j])) {\n 155 | return 0;\n 156 | }\n 157 | \n 158 | if (!dp_atomsInPlay || (*dp_atomsInPlay)[i]) {\n 159 | updateAtomNeighborIndex(dp_atoms, dp_atoms[i].bonds);\n 160 | }\n 161 | if (!dp_atomsInPlay || (*dp_atomsInPlay)[j]) {\n 162 | updateAtomNeighborIndex(dp_atoms, dp_atoms[j].bonds);\n 163 | }\n 164 | for (unsigned int ii = 0;\n 165 | ii < dp_atoms[i].bonds.size() && ii < dp_atoms[j].bonds.size(); ++ii) {\n 166 | int cmp =\n 167 | bondholder::compare(dp_atoms[i].bonds[ii], dp_atoms[j].bonds[ii]);\n 168 | if (cmp) {\n 169 | return cmp;\n 170 | }\n 171 | }\n 172 | \n 173 | std::vector> swapsi;\n 174 | std::vector> swapsj;\n 175 | if (!dp_atomsInPlay || (*dp_atomsInPlay)[i]) {\n 176 | updateAtomNeighborNumSwaps(dp_atoms, dp_atoms[i].bonds, i, swapsi);\n 177 | }\n 178 | if (!dp_atomsInPlay || (*dp_atomsInPlay)[j]) {\n 179 | updateAtomNeighborNumSwaps(dp_atoms, dp_atoms[j].bonds, j, swapsj);\n 180 | }\n 181 | \n 182 | for (unsigned int ii = 0; ii < swapsi.size() && ii < swapsj.size(); ++ii) {\n 183 | int cmp = swapsi[ii].second - swapsj[ii].second;\n 184 | \n 185 | if (cmp) {\n 186 | return cmp;\n 187 | }\n 188 | }\n 189 | \n 190 | return 0;\n 191 | }\n 192 | };\n 193 | \n 194 | class RDKIT_GRAPHMOL_EXPORT SpecialSymmetryAtomCompareFunctor {\n 195 | public:\n 196 | Canon::canon_atom *dp_atoms{nullptr};\n 197 | const ROMol *dp_mol{nullptr};\n 198 | const boost::dynamic_bitset<> *dp_atomsInPlay{nullptr},\n 199 | *dp_bondsInPlay{nullptr};\n 200 | \n 201 | SpecialSymmetryAtomCompareFunctor() {}\n 202 | SpecialSymmetryAtomCompareFunctor(\n 203 | Canon::canon_atom *atoms, const ROMol &m,\n 204 | const boost::dynamic_bitset<> *atomsInPlay = nullptr,\n 205 | const boost::dynamic_bitset<> *bondsInPlay = nullptr)\n 206 | : dp_atoms(atoms),\n 207 | dp_mol(&m),\n 208 | dp_atomsInPlay(atomsInPlay),\n 209 | dp_bondsInPlay(bondsInPlay) {}\n 210 | int operator()(int i, int j) const {\n 211 | PRECONDITION(dp_atoms, \"no atoms\");\n 212 | PRECONDITION(dp_mol, \"no molecule\");\n 213 | PRECONDITION(i != j, \"bad call\");\n 214 | if (dp_atomsInPlay && !((*dp_atomsInPlay)[i] || (*dp_atomsInPlay)[j])) {\n 215 | return 0;\n 216 | }\n 217 | \n 218 | if (dp_atoms[i].neighborNum < dp_atoms[j].neighborNum) {\n 219 | return -1;\n 220 | } else if (dp_atoms[i].neighborNum > dp_atoms[j].neighborNum) {\n 221 | return 1;\n 222 | }\n 223 | \n 224 | if (dp_atoms[i].revistedNeighbors < dp_atoms[j].revistedNeighbors) {\n 225 | return -1;\n 226 | } else if (dp_atoms[i].revistedNeighbors > dp_atoms[j].revistedNeighbors) {\n 227 | return 1;\n 228 | }\n 229 | \n 230 | if (!dp_atomsInPlay || (*dp_atomsInPlay)[i]) {\n 231 | updateAtomNeighborIndex(dp_atoms, dp_atoms[i].bonds);\n 232 | }\n 233 | if (!dp_atomsInPlay || (*dp_atomsInPlay)[j]) {\n 234 | updateAtomNeighborIndex(dp_atoms, dp_atoms[j].bonds);\n 235 | }\n 236 | for (unsigned int ii = 0;\n 237 | ii < dp_atoms[i].bonds.size() && ii < dp_atoms[j].bonds.size(); ++ii) {\n 238 | int cmp =\n 239 | bondholder::compare(dp_atoms[i].bonds[ii], dp_atoms[j].bonds[ii]);\n 240 | if (cmp) {\n 241 | return cmp;\n 242 | }\n 243 | }\n 244 | \n 245 | if (dp_atoms[i].bonds.size() < dp_atoms[j].bonds.size()) {\n 246 | return -1;\n 247 | } else if (dp_atoms[i].bonds.size() > dp_atoms[j].bonds.size()) {\n> 248 | return 1;\n 249 | }\n 250 | return 0;\n 251 | }\n 252 | };\n 253 | \n 254 | namespace {\n 255 | unsigned int getChiralRank(const ROMol *dp_mol, canon_atom *dp_atoms,\n 256 | unsigned int i) {\n 257 | unsigned int res = 0;\n 258 | std::vector perm;\n 259 | perm.reserve(dp_atoms[i].atom->getDegree());\n 260 | for (const auto nbr : dp_mol->atomNeighbors(dp_atoms[i].atom)) {\n 261 | auto rnk = dp_atoms[nbr->getIdx()].index;\n 262 | // make sure we don't have duplicate ranks\n 263 | if (std::find(perm.begin(), perm.end(), rnk) != perm.end()) {\n 264 | break;\n 265 | } else {\n 266 | perm.push_back(rnk);\n 267 | }\n 268 | }\n 269 | if (perm.size() == dp_atoms[i].atom->getDegree()) {\n 270 | auto ctag = dp_atoms[i].atom->getChiralTag();\n 271 | if (ctag == Atom::ChiralType::CHI_TETRAHEDRAL_CW ||\n 272 | ctag == Atom::ChiralType::CHI_TETRAHEDRAL_CCW) {\n 273 | auto sortedPerm = perm;\n 274 | std::sort(sortedPerm.begin(), sortedPerm.end());\n 275 | auto nswaps = countSwapsToInterconvert(perm, sortedPerm);\n 276 | res = ctag == Atom::ChiralType::CHI_TETRAHEDRAL_CW ? 2 : 1;\n 277 | if (nswaps % 2) {\n 278 | res = res == 2 ? 1 : 2;\n 279 | }\n 280 | }\n 281 | }\n 282 | return res;\n 283 | }\n 284 | } // namespace\n 285 | class RDKIT_GRAPHMOL_EXPORT AtomCompareFunctor {\n 286 | unsigned int getAtomRingNbrCode(unsigned int i) const {\n 287 | if (!dp_atoms[i].hasRingNbr) {\n 288 | return 0;\n 289 | }\n 290 | \n 291 | auto nbrs = dp_atoms[i].nbrIds.get();\n 292 | unsigned int code = 0;\n 293 | for (unsigned j = 0; j < dp_atoms[i].degree; ++j) {\n 294 | if (dp_atoms[nbrs[j]].isRingStereoAtom) {\n 295 | code += dp_atoms[nbrs[j]].index * 10000 + 1; // j;\n 296 | }\n 297 | }\n 298 | return code;\n 299 | }\n 300 | \n 301 | int basecomp(int i, int j) const {\n 302 | unsigned int ivi, ivj;\n 303 | \n 304 | // always start with the current class:\n 305 | ivi = dp_atoms[i].index;\n 306 | ivj = dp_atoms[j].index;\n 307 | if (ivi < ivj) {\n 308 | return -1;\n 309 | } else if (ivi > ivj) {\n 310 | return 1;\n 311 | }\n 312 | \n 313 | if (df_useNonStereoRanks) {\n 314 | // use the non-stereo ranks if they were assigned\n 315 | int rankingNumber_i = 0;\n 316 | int rankingNumber_j = 0;\n 317 | dp_atoms[i].atom->getPropIfPresent(\n 318 | common_properties::_CanonicalRankingNumber, rankingNumber_i);\n 319 | dp_atoms[j].atom->getPropIfPresent(\n 320 | common_properties::_CanonicalRankingNumber, rankingNumber_j);\n 321 | if (rankingNumber_i < rankingNumber_j) {\n 322 | return -1;\n 323 | } else if (rankingNumber_i > rankingNumber_j) {\n 324 | return 1;\n 325 | }\n 326 | }\n 327 | \n 328 | if (df_useAtomMaps || df_useAtomMapsOnDummies) {\n 329 | // use the atom-mapping numbers if they were assigned\n 330 | int molAtomMapNumber_i = 0;\n 331 | int molAtomMapNumber_j = 0;\n 332 | if (df_useAtomMaps ||\n 333 | (df_useAtomMapsOnDummies && dp_atoms[i].atom->getAtomicNum() == 0)) {\n 334 | dp_atoms[i].atom->getPropIfPresent(common_properties::molAtomMapNumber,\n 335 | molAtomMapNumber_i);\n 336 | }\n 337 | if (df_useAtomMaps ||\n 338 | (df_useAtomMapsOnDummies && dp_atoms[j].atom->getAtomicNum() == 0)) {\n 339 | dp_atoms[j].atom->getPropIfPresent(common_properties::molAtomMapNumber,\n 340 | molAtomMapNumber_j);\n 341 | }\n 342 | if (molAtomMapNumber_i < molAtomMapNumber_j) {\n 343 | return -1;\n 344 | } else if (molAtomMapNumber_i > molAtomMapNumber_j) {\n 345 | return 1;\n 346 | }\n 347 | }\n 348 | // start by comparing degree", "src_commits": "[{\"path\":\"/src/eigen\",\"rev\":\"2cf9891537250255f50df5109ffe9e700e2a73de\",\"url\":\"https://gitlab.com/libeigen/eigen\"},{\"path\":\"/src/rdkit\",\"rev\":\"232e4ffc84de1983918e6422fbec47d5da74db25\",\"url\":\"https://github.com/rdkit/rdkit.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"smiles_string_to_mol_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/rdkit/Code/GraphMol/new_canon.h\"]", "target_text": "Reach line at /src/rdkit/Code/GraphMol/new_canon.h:248 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-rdkit:v2026-07-test1@sha256:3361dd349cc9e92dfe48e664b1c0fe61eeadf62cc08834e8f9ae28187f283320", "runtime_digest": "sha256:3361dd349cc9e92dfe48e664b1c0fe61eeadf62cc08834e8f9ae28187f283320", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"} {"target_id": "rdkit:merged:src/rdkit/Code/GraphMol/Aromaticity.cpp:419", "coin_version": "v2026-07", "coin_commit": "e99b764ba8d7a546e425666851b81545bc800f63", "oss_fuzz_commit": "d87225267726cf7ce1a3e17cf103c5ac943c4f05", "coverage_date": "20260504", "project": "rdkit", "harness": "merged", "harness_binaries": "[\"mol_data_stream_to_mol_fuzzer\", \"mol_deserialization_fuzzer\", \"smiles_string_to_mol_fuzzer\"]", "language": "c++", "file": "/src/rdkit/Code/GraphMol/Aromaticity.cpp", "line_start": 419, "line_end": 419, "line_count": 1, "function": "", "source_snippet": " 319 | curRs.push_back(fused.front());\n 320 | int pos = -1;\n 321 | unsigned int i;\n 322 | unsigned int curSize = 0;\n 323 | INT_VECT comb;\n 324 | \n 325 | size_t nRingBonds;\n 326 | {\n 327 | boost::dynamic_bitset<> fusedBonds(mol.getNumBonds());\n 328 | for (auto ridx : fused) {\n 329 | for (auto bidx : brings[ridx]) {\n 330 | fusedBonds[bidx] = true;\n 331 | }\n 332 | }\n 333 | nRingBonds = rdcast(fusedBonds.count());\n 334 | }\n 335 | std::set doneBonds;\n 336 | while (1) {\n 337 | if (pos == -1) {\n 338 | // If a ring system has more than 300 rings and a ring combination search\n 339 | // larger than 2 is reached, the calculation becomes exponentially longer,\n 340 | // in some case it never completes.\n 341 | if ((curSize == 2) && (nrings > 300)) {\n 342 | BOOST_LOG(rdWarningLog)\n 343 | << \"Aromaticity detection halted on some rings due to ring system size.\"\n 344 | << std::endl;\n 345 | break;\n 346 | }\n 347 | \n 348 | ++curSize;\n 349 | // check if we are done with all the atoms in the fused\n 350 | // system, if so quit. This is a fix for Issue252 REVIEW: is\n 351 | // this check sufficient or should we add an additional\n 352 | // constraint on the number of combinations of rings in a\n 353 | // fused system that we will try. The number of combinations\n 354 | // can obviously be quite large when the number of rings in\n 355 | // the fused system is large\n 356 | if (curSize > std::min(nrings, maxNumFusedRings) ||\n 357 | doneBonds.size() >= nRingBonds) {\n 358 | break;\n 359 | }\n 360 | comb.resize(curSize);\n 361 | std::iota(comb.begin(), comb.end(), 0);\n 362 | pos = 0;\n 363 | } else {\n 364 | pos = nextCombination(comb, nrings);\n 365 | }\n 366 | \n 367 | if (pos == -1) {\n 368 | continue;\n 369 | }\n 370 | \n 371 | curRs.clear();\n 372 | std::transform(comb.begin(), comb.end(), std::back_inserter(curRs),\n 373 | [&fused](const int i) { return fused[i]; });\n 374 | \n 375 | // check if the picked subsystem is fused\n 376 | if (ringNeighs.size() && !RingUtils::checkFused(curRs, ringNeighs)) {\n 377 | continue;\n 378 | }\n 379 | \n 380 | // check aromaticity on the current fused system\n 381 | INT_VECT atsInRingSystem(mol.getNumAtoms(), 0);\n 382 | for (auto ridx : curRs) {\n 383 | for (auto rid : srings[ridx]) {\n 384 | ++atsInRingSystem[rid];\n 385 | }\n 386 | }\n 387 | INT_VECT unon;\n 388 | for (i = 0; i < atsInRingSystem.size(); ++i) {\n 389 | // condition for inclusion of an atom in the aromaticity of a fused ring\n 390 | // system is that it's present in one or two of the rings. this was #2895:\n 391 | // the central atom in acepentalene was being included in the count of\n 392 | // aromatic atoms\n 393 | if (atsInRingSystem[i] == 1 || atsInRingSystem[i] == 2) {\n 394 | unon.push_back(i);\n 395 | }\n 396 | }\n 397 | if (applyHuckel(mol, unon, edon, minRingSize)) {\n 398 | // mark the atoms and bonds in these rings to be aromatic\n 399 | markAtomsBondsArom(brings, curRs, doneBonds, bondsByIdx);\n 400 | \n 401 | // add the ring IDs to the aromatic rings found so far\n 402 | // avoid duplicates\n 403 | std::copy(curRs.begin(), curRs.end(),\n 404 | std::inserter(aromRings, aromRings.begin()));\n 405 | } // end check huckel rule\n 406 | } // end while(1)\n 407 | narom += rdcast(aromRings.size());\n 408 | }\n 409 | \n 410 | bool isAtomCandForArom(const Atom *at, const ElectronDonorType edon,\n 411 | bool allowThirdRow = true, bool allowTripleBonds = true,\n 412 | bool allowHigherExceptions = true, bool onlyCorN = false,\n 413 | bool allowExocyclicMultipleBonds = true) {\n 414 | PRECONDITION(at, \"bad atom\");\n 415 | if (onlyCorN && at->getAtomicNum() != 6 && at->getAtomicNum() != 7) {\n 416 | return false;\n 417 | }\n 418 | if (!allowThirdRow && at->getAtomicNum() > 10) {\n> 419 | return false;\n 420 | }\n 421 | \n 422 | // limit aromaticity to:\n 423 | // - the first two rows of the periodic table\n 424 | // - Se and Te\n 425 | if (at->getAtomicNum() > 18 &&\n 426 | (!allowHigherExceptions ||\n 427 | (at->getAtomicNum() != 34 && at->getAtomicNum() != 52))) {\n 428 | return false;\n 429 | }\n 430 | switch (edon) {\n 431 | case VacantElectronDonorType:\n 432 | case OneElectronDonorType:\n 433 | case TwoElectronDonorType:\n 434 | case OneOrTwoElectronDonorType:\n 435 | case AnyElectronDonorType:\n 436 | break;\n 437 | default:\n 438 | return (false);\n 439 | }\n 440 | \n 441 | // atoms that aren't in their default valence state also get shut out\n 442 | auto defVal =\n 443 | PeriodicTable::getTable()->getDefaultValence(at->getAtomicNum());\n 444 | if (defVal > 0 && rdcast(at->getTotalValence()) >\n 445 | (PeriodicTable::getTable()->getDefaultValence(\n 446 | at->getAtomicNum() - at->getFormalCharge()))) {\n 447 | return false;\n 448 | }\n 449 | \n 450 | // heteroatoms or charged carbons with radicals also disqualify us from being\n 451 | // considered. This was github issue 432 (heteroatoms) and 1936 (charged\n 452 | // carbons)\n 453 | if (at->getNumRadicalElectrons() &&\n 454 | (at->getAtomicNum() != 6 || at->getFormalCharge())) {\n 455 | return false;\n 456 | }\n 457 | \n 458 | // We are going to explicitly disallow atoms that have more\n 459 | // than one double or triple bond. This is to handle\n 460 | // the situation:\n 461 | // C1=C=NC=N1 (sf.net bug 1934360)\n 462 | int nUnsaturations =\n 463 | at->getValence(Atom::ValenceType::EXPLICIT) - at->getDegree();\n 464 | if (nUnsaturations > 1) {\n 465 | unsigned int nMult = 0;\n 466 | const auto &mol = at->getOwningMol();\n 467 | for (const auto bond : mol.atomBonds(at)) {\n 468 | switch (bond->getBondType()) {\n 469 | case Bond::SINGLE:\n 470 | case Bond::AROMATIC:\n 471 | break;\n 472 | case Bond::DOUBLE:\n 473 | ++nMult;\n 474 | break;\n 475 | case Bond::TRIPLE:\n 476 | if (!allowTripleBonds) {\n 477 | return false;\n 478 | }\n 479 | ++nMult;\n 480 | break;\n 481 | default:\n 482 | // hopefully we had enough sense that we don't even\n 483 | // get here with these bonds... If we do land here,\n 484 | // just bail... I have no good answer for them.\n 485 | break;\n 486 | }\n 487 | if (nMult > 1) {\n 488 | break;\n 489 | }\n 490 | }\n 491 | if (nMult > 1) {\n 492 | return (false);\n 493 | }\n 494 | }\n 495 | \n 496 | if (!allowExocyclicMultipleBonds) {\n 497 | const auto &mol = at->getOwningMol();\n 498 | for (const auto bond : mol.atomBonds(at)) {\n 499 | if ((bond->getBondType() == Bond::DOUBLE ||\n 500 | bond->getBondType() == Bond::TRIPLE) &&\n 501 | !queryIsBondInRing(bond)) {\n 502 | return false;\n 503 | }\n 504 | }\n 505 | }\n 506 | \n 507 | return (true);\n 508 | }\n 509 | \n 510 | ElectronDonorType getAtomDonorTypeArom(\n 511 | const Atom *at, bool exocyclicBondsStealElectrons = true) {\n 512 | PRECONDITION(at, \"bad atom\");\n 513 | const auto &mol = at->getOwningMol();\n 514 | if (at->getAtomicNum() == 0) {\n 515 | return incidentCyclicMultipleBond(at) ? OneElectronDonorType\n 516 | : AnyElectronDonorType;\n 517 | }\n 518 | \n 519 | ElectronDonorType res = NoElectronDonorType;", "src_commits": "[{\"path\":\"/src/eigen\",\"rev\":\"2cf9891537250255f50df5109ffe9e700e2a73de\",\"url\":\"https://gitlab.com/libeigen/eigen\"},{\"path\":\"/src/rdkit\",\"rev\":\"232e4ffc84de1983918e6422fbec47d5da74db25\",\"url\":\"https://github.com/rdkit/rdkit.git\"}]", "gcs_covered": false, "baseline_reachable": "[]", "agent_baseline_reachable": "[]", "codeql_reachable": "[\"smiles_string_to_mol_fuzzer\"]", "cnt": 0, "coverage_keys": "[\"/src/rdkit/Code/GraphMol/Aromaticity.cpp\"]", "target_text": "Reach line at /src/rdkit/Code/GraphMol/Aromaticity.cpp:419 (observed count 0).", "prompt_preview": "", "runtime_image": "localhost:5000/cointest/runtime-rdkit:v2026-07-test1@sha256:3361dd349cc9e92dfe48e664b1c0fe61eeadf62cc08834e8f9ae28187f283320", "runtime_digest": "sha256:3361dd349cc9e92dfe48e664b1c0fe61eeadf62cc08834e8f9ae28187f283320", "runtime_normal_path": "/out/normal", "runtime_coverage_path": "/out/coverage", "runtime_source_path": "/src", "oss_fuzz_runner_image": "gcr.io/oss-fuzz-base/base-runner", "coverage_extra_args": "", "split": "codeql_only"}