Language: C
Label: safe
CWE: CWE-120 \u2014 Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.

Code:
main(int argc, char* argv[])
{
    (void) argc;
    (void) argv;

    const struct CMUnitTest tests[] = {
            /* Layer tests */
            cmocka_unit_test(test_layers),
            cmocka_unit_test(test_tpm_format_0_version2_0_error),
            cmocka_unit_test(test_tpm_format_0_version2_0_warn),
            cmocka_unit_test(test_tpm2_format_0_unknown),
            cmocka_unit_test(test_tpm_format_1_unk_handle),
            cmocka_unit_test(test_tpm_format_1_unk_parameter),
            cmocka_unit_test(test_tpm_format_1_unk_session),
            cmocka_unit_test(test_tpm_format_1_5_handle),
            cmocka_unit_test(test_tpm2_format_1_unknown),
            cmocka_unit_test(test_tpm2_format_1_success),
            cmocka_unit_test(test_custom_handler),
            cmocka_unit_test(test_zero_length_name),
            cmocka_unit_test(test_over_length_name),
            cmocka_unit_test(test_null_name),
            cmocka_unit_test(test_sys),
            cmocka_unit_test(test_esys),
            cmocka_unit_test(test_mu),
            cmocka_unit_test(test_tcti),
            cmocka_unit_test(test_info_fmt0),
            cmocka_unit_test(test_info_fmt1_parameter),
            cmocka_unit_test(test_info_fmt1_handle),
            cmocka_unit_test(test_info_fmt1_session),
            cmocka_unit_test(test_info_null),
            cmocka_unit_test(test_info_str_fmt1),
            cmocka_unit_test(test_info_str_fmt1_ff),
            cmocka_unit_test(test_info_str_fmt0_err),
            cmocka_unit_test(test_info_str_fmt0_warn),
            cmocka_unit_test(test_info_str_fmt0_ff),
            cmocka_unit_test(test_info_str_null),
            cmocka_unit_test(test_all_FFs),
            cmocka_unit_test(test_all_FFs_set_handler)
    };

    return cmocka_run_group_tests(tests, NULL, NULL);
}