Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 223 Examining data/cgreen-1.3.0/contrib/cgreen-mocker/complex_types.h Examining data/cgreen-1.3.0/contrib/cgreen-mocker/double.h Examining data/cgreen-1.3.0/contrib/cgreen-mocker/multiple_types.h Examining data/cgreen-1.3.0/contrib/cgreen-mocker/simple_types.h Examining data/cgreen-1.3.0/doc/tutorial_src/all_tests.c Examining data/cgreen-1.3.0/doc/tutorial_src/crash_tests.c Examining data/cgreen-1.3.0/doc/tutorial_src/crash_tests1.c Examining data/cgreen-1.3.0/doc/tutorial_src/crash_tests2.c Examining data/cgreen-1.3.0/doc/tutorial_src/crash_tests3.c Examining data/cgreen-1.3.0/doc/tutorial_src/custom_constraint1.c Examining data/cgreen-1.3.0/doc/tutorial_src/custom_constraint2.c Examining data/cgreen-1.3.0/doc/tutorial_src/custom_constraint3.c Examining data/cgreen-1.3.0/doc/tutorial_src/double_tests1.c Examining data/cgreen-1.3.0/doc/tutorial_src/first_tests0.c Examining data/cgreen-1.3.0/doc/tutorial_src/first_tests1.c Examining data/cgreen-1.3.0/doc/tutorial_src/first_tests2.c Examining data/cgreen-1.3.0/doc/tutorial_src/formatter_tests0.c Examining data/cgreen-1.3.0/doc/tutorial_src/formatter_tests1.c Examining data/cgreen-1.3.0/doc/tutorial_src/formatter_tests2.c Examining data/cgreen-1.3.0/doc/tutorial_src/formatter_tests3.c Examining data/cgreen-1.3.0/doc/tutorial_src/formatter_tests4.c Examining data/cgreen-1.3.0/doc/tutorial_src/formatter_tests5.c Examining data/cgreen-1.3.0/doc/tutorial_src/learning_mocks.c Examining data/cgreen-1.3.0/doc/tutorial_src/multiple_streams1.c Examining data/cgreen-1.3.0/doc/tutorial_src/multiple_streams2.c Examining data/cgreen-1.3.0/doc/tutorial_src/person.h Examining data/cgreen-1.3.0/doc/tutorial_src/person_tests.c Examining data/cgreen-1.3.0/doc/tutorial_src/read_paragraph1.c Examining data/cgreen-1.3.0/doc/tutorial_src/read_paragraph2.c Examining data/cgreen-1.3.0/doc/tutorial_src/read_paragraph3.c Examining data/cgreen-1.3.0/doc/tutorial_src/roman_tests.c Examining data/cgreen-1.3.0/doc/tutorial_src/schema_tests1.c Examining data/cgreen-1.3.0/doc/tutorial_src/schema_tests2.c Examining data/cgreen-1.3.0/doc/tutorial_src/side_effect.c Examining data/cgreen-1.3.0/doc/tutorial_src/stream.c Examining data/cgreen-1.3.0/doc/tutorial_src/stream.h Examining data/cgreen-1.3.0/doc/tutorial_src/stream1.c Examining data/cgreen-1.3.0/doc/tutorial_src/stream2.c Examining data/cgreen-1.3.0/doc/tutorial_src/stream_tests0.c Examining data/cgreen-1.3.0/doc/tutorial_src/stream_tests1.c Examining data/cgreen-1.3.0/doc/tutorial_src/stream_tests2.c Examining data/cgreen-1.3.0/doc/tutorial_src/stream_tests3.c Examining data/cgreen-1.3.0/doc/tutorial_src/stream_tests4.c Examining data/cgreen-1.3.0/doc/tutorial_src/strlen_tests1.c Examining data/cgreen-1.3.0/doc/tutorial_src/strlen_tests2.c Examining data/cgreen-1.3.0/doc/tutorial_src/strlen_tests3.c Examining data/cgreen-1.3.0/doc/tutorial_src/strlen_tests4.c Examining data/cgreen-1.3.0/doc/tutorial_src/strlen_tests5.c Examining data/cgreen-1.3.0/doc/tutorial_src/strlen_tests6.c Examining data/cgreen-1.3.0/doc/tutorial_src/strlen_tests7.c Examining data/cgreen-1.3.0/doc/tutorial_src/suite1.c Examining data/cgreen-1.3.0/doc/tutorial_src/suite_person_tests.c Examining data/cgreen-1.3.0/doc/tutorial_src/suite_strlen_tests.c Examining data/cgreen-1.3.0/doc/tutorial_src/test_as_xml0.c Examining data/cgreen-1.3.0/doc/tutorial_src/test_as_xml1.c Examining data/cgreen-1.3.0/doc/tutorial_src/words.c Examining data/cgreen-1.3.0/doc/tutorial_src/words.h Examining data/cgreen-1.3.0/doc/tutorial_src/words1.c Examining data/cgreen-1.3.0/doc/tutorial_src/words2.c Examining data/cgreen-1.3.0/doc/tutorial_src/words3.c Examining data/cgreen-1.3.0/doc/tutorial_src/words4.c Examining data/cgreen-1.3.0/doc/tutorial_src/words5.c Examining data/cgreen-1.3.0/doc/tutorial_src/words6.c Examining data/cgreen-1.3.0/doc/tutorial_src/words7.c Examining data/cgreen-1.3.0/doc/tutorial_src/words_tests0.c Examining data/cgreen-1.3.0/doc/tutorial_src/words_tests1.c Examining data/cgreen-1.3.0/doc/tutorial_src/words_tests2.c Examining data/cgreen-1.3.0/doc/tutorial_src/words_tests3.c Examining data/cgreen-1.3.0/doc/tutorial_src/words_tests4.c Examining data/cgreen-1.3.0/doc/tutorial_src/xml_reporter.c Examining data/cgreen-1.3.0/doc/tutorial_src/xml_reporter.h Examining data/cgreen-1.3.0/doc/tutorial_src/xml_reporter0.c Examining data/cgreen-1.3.0/doc/tutorial_src/xml_reporter1.c Examining data/cgreen-1.3.0/doc/tutorial_src/xml_reporter2.c Examining data/cgreen-1.3.0/doc/tutorial_src/xml_reporter3.c Examining data/cgreen-1.3.0/doc/tutorial_src/xml_reporter4.c Examining data/cgreen-1.3.0/include/cgreen/assertions.h Examining data/cgreen-1.3.0/include/cgreen/boxed_double.h Examining data/cgreen-1.3.0/include/cgreen/breadcrumb.h Examining data/cgreen-1.3.0/include/cgreen/cdash_reporter.h Examining data/cgreen-1.3.0/include/cgreen/cgreen.h Examining data/cgreen-1.3.0/include/cgreen/cgreen_value.h Examining data/cgreen-1.3.0/include/cgreen/constraint.h Examining data/cgreen-1.3.0/include/cgreen/constraint_syntax_helpers.h Examining data/cgreen-1.3.0/include/cgreen/cpp_assertions.h Examining data/cgreen-1.3.0/include/cgreen/cpp_constraint.h Examining data/cgreen-1.3.0/include/cgreen/cute_reporter.h Examining data/cgreen-1.3.0/include/cgreen/internal/android_headers/androidcompat.h Examining data/cgreen-1.3.0/include/cgreen/internal/assertions_internal.h Examining data/cgreen-1.3.0/include/cgreen/internal/c_assertions.h Examining data/cgreen-1.3.0/include/cgreen/internal/cgreen_pipe.h Examining data/cgreen-1.3.0/include/cgreen/internal/cgreen_time.h Examining data/cgreen-1.3.0/include/cgreen/internal/cpp_assertions.h Examining data/cgreen-1.3.0/include/cgreen/internal/function_macro.h Examining data/cgreen-1.3.0/include/cgreen/internal/mock_table.h Examining data/cgreen-1.3.0/include/cgreen/internal/mocks_internal.h Examining data/cgreen-1.3.0/include/cgreen/internal/runner_platform.h Examining data/cgreen-1.3.0/include/cgreen/internal/stringify_token.h Examining data/cgreen-1.3.0/include/cgreen/internal/suite_internal.h Examining data/cgreen-1.3.0/include/cgreen/internal/unit_implementation.h Examining data/cgreen-1.3.0/include/cgreen/internal/windows_headers/inttypes.h Examining data/cgreen-1.3.0/include/cgreen/internal/windows_headers/stdbool.h Examining data/cgreen-1.3.0/include/cgreen/internal/windows_headers/unistd.h Examining data/cgreen-1.3.0/include/cgreen/internal/windows_headers/wincompat.h Examining data/cgreen-1.3.0/include/cgreen/legacy.h Examining data/cgreen-1.3.0/include/cgreen/message_formatting.h Examining data/cgreen-1.3.0/include/cgreen/messaging.h Examining data/cgreen-1.3.0/include/cgreen/mocks.h Examining data/cgreen-1.3.0/include/cgreen/reporter.h Examining data/cgreen-1.3.0/include/cgreen/runner.h Examining data/cgreen-1.3.0/include/cgreen/string_comparison.h Examining data/cgreen-1.3.0/include/cgreen/text_reporter.h Examining data/cgreen-1.3.0/include/cgreen/unit.h Examining data/cgreen-1.3.0/include/cgreen/vector.h Examining data/cgreen-1.3.0/include/cgreen/xml_reporter.h Examining data/cgreen-1.3.0/include/cgreen/suite.h Examining data/cgreen-1.3.0/samples/sample.c Examining data/cgreen-1.3.0/src/assertions.c Examining data/cgreen-1.3.0/src/boxed_double.c Examining data/cgreen-1.3.0/src/breadcrumb.c Examining data/cgreen-1.3.0/src/cdash_reporter.c Examining data/cgreen-1.3.0/src/cdash_reporter_internal.h Examining data/cgreen-1.3.0/src/cgreen_time.c Examining data/cgreen-1.3.0/src/cgreen_value.c Examining data/cgreen-1.3.0/src/cgreen_value_internal.h Examining data/cgreen-1.3.0/src/constraint.c Examining data/cgreen-1.3.0/src/constraint_internal.h Examining data/cgreen-1.3.0/src/constraint_syntax_helpers.c Examining data/cgreen-1.3.0/src/cpp_assertions.cpp Examining data/cgreen-1.3.0/src/cpp_constraint.cpp Examining data/cgreen-1.3.0/src/cute_reporter.c Examining data/cgreen-1.3.0/src/cute_reporter_internal.h Examining data/cgreen-1.3.0/src/local_messaging.cpp Examining data/cgreen-1.3.0/src/memory.c Examining data/cgreen-1.3.0/src/memory.h Examining data/cgreen-1.3.0/src/message_formatting.c Examining data/cgreen-1.3.0/src/messaging.c Examining data/cgreen-1.3.0/src/mocks.c Examining data/cgreen-1.3.0/src/parameters.c Examining data/cgreen-1.3.0/src/parameters.h Examining data/cgreen-1.3.0/src/posix_cgreen_pipe.c Examining data/cgreen-1.3.0/src/posix_cgreen_time.c Examining data/cgreen-1.3.0/src/posix_runner_platform.c Examining data/cgreen-1.3.0/src/reporter.c Examining data/cgreen-1.3.0/src/runner.c Examining data/cgreen-1.3.0/src/runner.h Examining data/cgreen-1.3.0/src/string_comparison.c Examining data/cgreen-1.3.0/src/text_reporter.c Examining data/cgreen-1.3.0/src/text_reporter_internal.h Examining data/cgreen-1.3.0/src/utils.c Examining data/cgreen-1.3.0/src/vector.c Examining data/cgreen-1.3.0/src/win32_cgreen.h Examining data/cgreen-1.3.0/src/win32_cgreen_pipe.c Examining data/cgreen-1.3.0/src/win32_cgreen_time.c Examining data/cgreen-1.3.0/src/win32_runner_platform.c Examining data/cgreen-1.3.0/src/xml_reporter.c Examining data/cgreen-1.3.0/src/xml_reporter_internal.h Examining data/cgreen-1.3.0/src/suite.c Examining data/cgreen-1.3.0/src/utils.h Examining data/cgreen-1.3.0/tests/all_c_tests.c Examining data/cgreen-1.3.0/tests/all_cpp_tests.cpp Examining data/cgreen-1.3.0/tests/api/core_api.c Examining data/cgreen-1.3.0/tests/api/suites_with_context_api.c Examining data/cgreen-1.3.0/tests/api/suites_without_context_api.c Examining data/cgreen-1.3.0/tests/assertion_messages_tests.c Examining data/cgreen-1.3.0/tests/assertion_tests.c Examining data/cgreen-1.3.0/tests/assertion_tests.cpp Examining data/cgreen-1.3.0/tests/breadcrumb_tests.c Examining data/cgreen-1.3.0/tests/breadcrumb_tests.cpp Examining data/cgreen-1.3.0/tests/cdash_reporter_tests.c Examining data/cgreen-1.3.0/tests/cdash_reporter_tests.cpp Examining data/cgreen-1.3.0/tests/cgreen_value_tests.c Examining data/cgreen-1.3.0/tests/cgreen_value_tests.cpp Examining data/cgreen-1.3.0/tests/constraint_tests.c Examining data/cgreen-1.3.0/tests/constraint_tests.cpp Examining data/cgreen-1.3.0/tests/cpp_assertion_tests.cpp Examining data/cgreen-1.3.0/tests/cute_reporter_tests.c Examining data/cgreen-1.3.0/tests/cute_reporter_tests.cpp Examining data/cgreen-1.3.0/tests/double_tests.c Examining data/cgreen-1.3.0/tests/double_tests.cpp Examining data/cgreen-1.3.0/tests/environment_variables_tests.c Examining data/cgreen-1.3.0/tests/environment_variables_tests.cpp Examining data/cgreen-1.3.0/tests/failure_messages_tests.c Examining data/cgreen-1.3.0/tests/ignore_messages_tests.c Examining data/cgreen-1.3.0/tests/message_formatting_tests.c Examining data/cgreen-1.3.0/tests/message_formatting_tests.cpp Examining data/cgreen-1.3.0/tests/messaging_tests.c Examining data/cgreen-1.3.0/tests/messaging_tests.cpp Examining data/cgreen-1.3.0/tests/mock_messages_tests.c Examining data/cgreen-1.3.0/tests/mocks_tests.c Examining data/cgreen-1.3.0/tests/mocks_tests.cpp Examining data/cgreen-1.3.0/tests/parameters_tests.c Examining data/cgreen-1.3.0/tests/parameters_tests.cpp Examining data/cgreen-1.3.0/tests/reflective_runner_no_teardown_tests.c Examining data/cgreen-1.3.0/tests/reflective_runner_no_teardown_tests.cpp Examining data/cgreen-1.3.0/tests/reflective_tests.c Examining data/cgreen-1.3.0/tests/reflective_tests.cpp Examining data/cgreen-1.3.0/tests/text_reporter_tests.c Examining data/cgreen-1.3.0/tests/text_reporter_tests.cpp Examining data/cgreen-1.3.0/tests/unit_tests.c Examining data/cgreen-1.3.0/tests/unit_tests.cpp Examining data/cgreen-1.3.0/tests/utils_tests.c Examining data/cgreen-1.3.0/tests/vector_tests.c Examining data/cgreen-1.3.0/tests/vector_tests.cpp Examining data/cgreen-1.3.0/tests/xml_output_tests.c Examining data/cgreen-1.3.0/tests/xml_reporter_tests.c Examining data/cgreen-1.3.0/tests/xml_reporter_tests.cpp Examining data/cgreen-1.3.0/tests/constraint_messages_tests.c Examining data/cgreen-1.3.0/tests/custom_constraint_messages_tests.c Examining data/cgreen-1.3.0/tools/cgreen-runner.c Examining data/cgreen-1.3.0/tools/discoverer.c Examining data/cgreen-1.3.0/tools/discoverer.h Examining data/cgreen-1.3.0/tools/discoverer_acceptance_tests.c Examining data/cgreen-1.3.0/tools/discoverer_unit_tests.c Examining data/cgreen-1.3.0/tools/gopt-errors.c Examining data/cgreen-1.3.0/tools/gopt.c Examining data/cgreen-1.3.0/tools/gopt.h Examining data/cgreen-1.3.0/tools/io.c Examining data/cgreen-1.3.0/tools/io.h Examining data/cgreen-1.3.0/tools/runner.c Examining data/cgreen-1.3.0/tools/runner.h Examining data/cgreen-1.3.0/tools/test_item.c Examining data/cgreen-1.3.0/tools/test_item.h Examining data/cgreen-1.3.0/tools/tests/runnerTests.c FINAL RESULTS: data/cgreen-1.3.0/doc/tutorial_src/xml_reporter.c:50:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(message, arguments); data/cgreen-1.3.0/doc/tutorial_src/xml_reporter2.c:22:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(message, arguments); data/cgreen-1.3.0/doc/tutorial_src/xml_reporter3.c:21:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(message, arguments); data/cgreen-1.3.0/doc/tutorial_src/xml_reporter4.c:34:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(message, arguments); data/cgreen-1.3.0/include/cgreen/internal/android_headers/androidcompat.h:27:9: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define printf(fmt, ...) LOGE(fmt, ##__VA_ARGS__) data/cgreen-1.3.0/include/cgreen/internal/android_headers/androidcompat.h:28:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define fprintf(stderr, ...) LOGE(__VA_ARGS__) data/cgreen-1.3.0/include/cgreen/internal/android_headers/androidcompat.h:29:9: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define vprintf(fmt, ...) LOGE(fmt, ##__VA_ARGS__) data/cgreen-1.3.0/include/cgreen/internal/android_headers/androidcompat.h:30:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf(buf, len, fmt, ...) LOGE(fmt, ##__VA_ARGS__) data/cgreen-1.3.0/include/cgreen/internal/android_headers/androidcompat.h:31:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. #define sprintf(buf, fmt, ...) LOGE(fmt, ##__VA_ARGS__) data/cgreen-1.3.0/include/cgreen/internal/windows_headers/unistd.h:25:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. #define access _access data/cgreen-1.3.0/include/cgreen/internal/windows_headers/wincompat.h:13:12: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf sprintf_s data/cgreen-1.3.0/src/cdash_reporter.c:89:42: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. set_cdash_reporter_printer(reporter, fprintf); data/cgreen-1.3.0/src/cdash_reporter.c:90:43: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. set_cdash_reporter_vprinter(reporter, vfprintf); data/cgreen-1.3.0/src/cgreen_value.c:11:16: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). return strcpy((char *)malloc(strlen(string)+1), string); data/cgreen-1.3.0/src/cute_reporter.c:62:41: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. set_cute_reporter_printer(reporter, printf); data/cgreen-1.3.0/src/cute_reporter.c:63:42: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. set_cute_reporter_vprinter(reporter, vprintf); data/cgreen-1.3.0/src/message_formatting.c:52:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(destination, source); data/cgreen-1.3.0/src/message_formatting.c:139:13: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:148:13: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:156:13: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:193:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(actual_int_value_string, sizeof(actual_int_value_string) - 1, "%" PRIdPTR, actual_value); data/cgreen-1.3.0/src/message_formatting.c:209:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(message, message_size - 1, data/cgreen-1.3.0/src/message_formatting.c:222:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:235:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:240:13: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:261:13: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:264:13: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:273:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:280:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/parameters.c:16:12: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). return strcpy((char *)malloc(strlen(string)+1), string); data/cgreen-1.3.0/src/runner.c:341:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(message, arguments); data/cgreen-1.3.0/src/text_reporter.c:82:41: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. set_text_reporter_printer(reporter, printf); data/cgreen-1.3.0/src/text_reporter.c:83:42: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. set_text_reporter_vprinter(reporter, vprintf); data/cgreen-1.3.0/src/text_reporter.c:134:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buff, "%s%d %s%s%s", count>0?color_on:"", count, name, count==1?"":plural, color_off); data/cgreen-1.3.0/src/text_reporter.c:176:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s", prepend); data/cgreen-1.3.0/src/text_reporter.c:179:13: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buf, format_passes(passes, use_colors)); data/cgreen-1.3.0/src/text_reporter.c:182:13: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buf, format_skips(skips, use_colors)); data/cgreen-1.3.0/src/text_reporter.c:186:13: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buf, format_failures(failures, use_colors)); data/cgreen-1.3.0/src/text_reporter.c:190:13: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buf, format_exceptions(exceptions, use_colors)); data/cgreen-1.3.0/src/text_reporter.c:192:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buf, format_duration(duration)); data/cgreen-1.3.0/src/text_reporter.c:226:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(prepend, " \"%s\": ", name); data/cgreen-1.3.0/src/text_reporter.c:244:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(prepend, "Completed \"%s\": ", name); data/cgreen-1.3.0/src/utils.c:26:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(dup, string); data/cgreen-1.3.0/src/utils.c:43:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "%sCGREEN EXCEPTION%s: <%s:%d>", data/cgreen-1.3.0/src/utils.c:47:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(&buffer[strlen(buffer)], fmt, args); data/cgreen-1.3.0/src/utils.c:51:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(panic_message_buffer, buffer); data/cgreen-1.3.0/src/xml_reporter.c:56:21: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. memo->printer = fprintf; data/cgreen-1.3.0/src/xml_reporter.c:132:26: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. if (memo->printer == fprintf) { data/cgreen-1.3.0/src/xml_reporter.c:179:12: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). return strcat(result, tail); data/cgreen-1.3.0/src/xml_reporter.c:199:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), message, arguments); data/cgreen-1.3.0/src/xml_reporter.c:219:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buffer, sizeof(buffer)/sizeof(buffer[0]), data/cgreen-1.3.0/tests/cdash_reporter_tests.c:30:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(output, buffer); data/cgreen-1.3.0/tests/cdash_reporter_tests.c:38:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(buffer, format, ap); data/cgreen-1.3.0/tests/cute_reporter_tests.c:32:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(output, buffer); data/cgreen-1.3.0/tests/cute_reporter_tests.c:39:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(buffer, format, arguments); data/cgreen-1.3.0/tests/text_reporter_tests.c:33:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(output, buffer); data/cgreen-1.3.0/tests/text_reporter_tests.c:40:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(buffer, format, ap); data/cgreen-1.3.0/tests/xml_reporter_tests.c:32:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(output, buffer); data/cgreen-1.3.0/tests/xml_reporter_tests.c:48:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(buffer, format, ap); data/cgreen-1.3.0/tools/cgreen-runner.c:21:13: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. return (access(filename, F_OK) == 0); data/cgreen-1.3.0/tools/discoverer.c:63:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(nm_command, "/usr/bin/nm '%s'", filename); data/cgreen-1.3.0/tools/discoverer_acceptance_tests.c:15:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(command, "/usr/bin/nm '%s'", filename); data/cgreen-1.3.0/tools/discoverer_acceptance_tests.c:16:23: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE *nm_output = popen(command, "r"); data/cgreen-1.3.0/tools/discoverer_unit_tests.c:58:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(command, "nm %s", filename); data/cgreen-1.3.0/tools/io.c:17:12: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return popen(command, mode); data/cgreen-1.3.0/tools/runner.c:272:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(tmp, file_path); data/cgreen-1.3.0/include/cgreen/internal/windows_headers/unistd.h:15:9: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define srandom srand data/cgreen-1.3.0/include/cgreen/internal/windows_headers/unistd.h:15:17: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define srandom srand data/cgreen-1.3.0/include/cgreen/internal/windows_headers/unistd.h:16:9: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define random rand data/cgreen-1.3.0/src/posix_runner_platform.c:100:9: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("CGREEN_CHILD_EXIT_WITH__EXIT") == NULL) data/cgreen-1.3.0/src/runner.c:84:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("CGREEN_NO_FORK") == NULL) data/cgreen-1.3.0/src/runner.c:157:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. return getenv(CGREEN_PER_TEST_TIMEOUT_ENVIRONMENT_VARIABLE) != NULL; data/cgreen-1.3.0/src/runner.c:168:22: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. timeout_string = getenv(CGREEN_PER_TEST_TIMEOUT_ENVIRONMENT_VARIABLE); data/cgreen-1.3.0/src/win32_runner_platform.c:22:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (NULL != getenv("CGREEN_CHILD_EXIT_WITH_FLUSH")) data/cgreen-1.3.0/tests/environment_variables_tests.c:19:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. assert_that(getenv("TEST"), is_equal_to_string("test")); data/cgreen-1.3.0/tests/failure_messages_tests.c:27:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. assert_that(getenv("CGREEN_PER_TEST_TIMEOUT"), is_not_equal_to(NULL)); data/cgreen-1.3.0/src/cdash_reporter.c:69:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sbuildstamp[15]; data/cgreen-1.3.0/src/cdash_reporter.c:70:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char strstart[30]; data/cgreen-1.3.0/src/cdash_reporter.c:71:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char reporter_path[255]; data/cgreen-1.3.0/src/cdash_reporter.c:101:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = fopen("./Testing/TAG", "w+"); data/cgreen-1.3.0/src/cdash_reporter.c:124:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = fopen(reporter_path, "w+"); data/cgreen-1.3.0/src/cdash_reporter.c:168:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char endtime[30]; data/cgreen-1.3.0/src/cdash_reporter.c:324:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char s[15]; data/cgreen-1.3.0/src/cdash_reporter.c:338:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char s[20]; data/cgreen-1.3.0/src/constraint.c:410:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void*)actual_return, (void*)value_to_return, size); data/cgreen-1.3.0/src/constraint.c:541:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parameter_name_actual_string[255]; data/cgreen-1.3.0/src/message_formatting.c:47:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(destination, source, len); data/cgreen-1.3.0/src/message_formatting.c:174:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char actual_int_value_string[32]; data/cgreen-1.3.0/src/message_formatting.c:266:24: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((char *)actual_value)[difference_index], data/cgreen-1.3.0/src/mocks.c:379:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parameter_name_actual_string[255]; data/cgreen-1.3.0/src/posix_runner_platform.c:52:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/cgreen-1.3.0/src/runner.c:169:21: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). timeout_value = atoi(timeout_string); data/cgreen-1.3.0/src/text_reporter.c:138:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buff[100]; data/cgreen-1.3.0/src/text_reporter.c:144:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buff[100]; data/cgreen-1.3.0/src/text_reporter.c:150:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buff[100]; data/cgreen-1.3.0/src/text_reporter.c:156:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buff[100]; data/cgreen-1.3.0/src/text_reporter.c:162:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buff[100]; data/cgreen-1.3.0/src/text_reporter.c:169:9: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buf, ", "); data/cgreen-1.3.0/src/text_reporter.c:194:9: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buf, "No assertions"); data/cgreen-1.3.0/src/text_reporter.c:223:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1000]; data/cgreen-1.3.0/src/text_reporter.c:224:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char prepend[100]; data/cgreen-1.3.0/src/utils.c:40:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1000]; data/cgreen-1.3.0/src/win32_cgreen_pipe.c:37:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char handleString[256]; data/cgreen-1.3.0/src/win32_cgreen_pipe.c:45:25: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). pipes[0] = (int)atoi(handleString); data/cgreen-1.3.0/src/win32_cgreen_pipe.c:47:25: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). pipes[1] = (int)atoi(handleString); data/cgreen-1.3.0/src/win32_runner_platform.c:76:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char testName[256]; data/cgreen-1.3.0/src/win32_runner_platform.c:103:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char env[MAX_PATH]; data/cgreen-1.3.0/src/win32_runner_platform.c:141:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[MAX_PATH+1]; //make enough room for full path plus null terminator data/cgreen-1.3.0/src/win32_runner_platform.c:143:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char handleString[256]; data/cgreen-1.3.0/src/xml_reporter.c:74:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[1000]; data/cgreen-1.3.0/src/xml_reporter.c:100:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char suite_path[PATH_MAX]; data/cgreen-1.3.0/src/xml_reporter.c:115:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/cgreen-1.3.0/src/xml_reporter.c:134:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). out = fopen(filename, "w"); data/cgreen-1.3.0/src/xml_reporter.c:173:28: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). child_output_tmpfile = tmpfile(); data/cgreen-1.3.0/src/xml_reporter.c:194:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1000]; data/cgreen-1.3.0/src/xml_reporter.c:215:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1000]; data/cgreen-1.3.0/src/xml_reporter.c:234:40: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). static void transfer_output_from(FILE *tmpfile, XmlPrinter printer, FILE *out) { data/cgreen-1.3.0/src/xml_reporter.c:235:11: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). fseek(tmpfile, 0, SEEK_SET); data/cgreen-1.3.0/src/xml_reporter.c:236:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1000]; data/cgreen-1.3.0/src/xml_reporter.c:237:32: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). while (fgets(buffer, 1000, tmpfile) != NULL) data/cgreen-1.3.0/tests/api/core_api.c:24:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char array[5]; data/cgreen-1.3.0/tests/assertion_messages_tests.c:18:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char something[42]; data/cgreen-1.3.0/tests/assertion_messages_tests.c:28:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char area[100]; data/cgreen-1.3.0/tests/assertion_messages_tests.c:34:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char area[100]; data/cgreen-1.3.0/tests/cdash_reporter_tests.c:37:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[10000]; data/cgreen-1.3.0/tests/constraint_messages_tests.c:40:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char bytes[4]; data/cgreen-1.3.0/tests/constraint_messages_tests.c:63:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char forty_five[45] = {45, 44, 43}, thirty_three[33] = {45, 44, 33}; data/cgreen-1.3.0/tests/constraint_tests.c:237:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char chars[3]; data/cgreen-1.3.0/tests/cute_reporter_tests.c:37:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[10000]; data/cgreen-1.3.0/tests/messaging_tests.c:47:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char panic_message[1000]; data/cgreen-1.3.0/tests/mocks_tests.c:195:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&s, sp, sizeof(S)); data/cgreen-1.3.0/tests/text_reporter_tests.c:38:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[10000]; data/cgreen-1.3.0/tests/utils_tests.c:12:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[100]; data/cgreen-1.3.0/tests/utils_tests.c:19:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[100]; data/cgreen-1.3.0/tests/vector_tests.c:125:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char panic_message[1000]; data/cgreen-1.3.0/tests/vector_tests.c:136:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char panic_message[1000]; data/cgreen-1.3.0/tests/xml_reporter_tests.c:45:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[10000]; data/cgreen-1.3.0/tools/cgreen-runner.c:177:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char in_libraries_text[100] = ""; data/cgreen-1.3.0/tools/cgreen-runner.c:178:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(in_libraries_text, " in %d libraries", library_count); data/cgreen-1.3.0/tools/discoverer.c:39:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[1000]; data/cgreen-1.3.0/tools/discoverer.c:62:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nm_command[1000]; data/cgreen-1.3.0/tools/discoverer_acceptance_tests.c:14:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char command[1000]; data/cgreen-1.3.0/tools/discoverer_acceptance_tests.c:17:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[10000]; data/cgreen-1.3.0/tools/discoverer_unit_tests.c:55:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char command[100]; data/cgreen-1.3.0/tools/io.c:9:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). return fopen(filename, mode); data/cgreen-1.3.0/tools/runner.c:271:9: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(tmp, "./"); data/cgreen-1.3.0/doc/tutorial_src/read_paragraph1.c:4:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream) { data/cgreen-1.3.0/doc/tutorial_src/read_paragraph1.c:8:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ch = (*read)(stream)) != EOF) { data/cgreen-1.3.0/doc/tutorial_src/read_paragraph2.c:4:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream) { data/cgreen-1.3.0/doc/tutorial_src/read_paragraph2.c:8:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ch = (*read)(stream)) != EOF) { data/cgreen-1.3.0/doc/tutorial_src/read_paragraph3.c:4:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream) { data/cgreen-1.3.0/doc/tutorial_src/read_paragraph3.c:8:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ch = (*read)(stream)) != EOF) { data/cgreen-1.3.0/doc/tutorial_src/side_effect.c:12:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream); data/cgreen-1.3.0/doc/tutorial_src/side_effect.c:14:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void by_paragraph(int (*read)(void *), void *in, void (*write)(void *, char *), void *out) { data/cgreen-1.3.0/doc/tutorial_src/side_effect.c:16:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *line = read_paragraph(read, in); data/cgreen-1.3.0/doc/tutorial_src/side_effect.c:17:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((line == NULL) || (strlen(line) == 0)) { data/cgreen-1.3.0/doc/tutorial_src/stream.c:5:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream) { data/cgreen-1.3.0/doc/tutorial_src/stream.c:9:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ch = (*read)(stream)) != EOF) { data/cgreen-1.3.0/doc/tutorial_src/stream.c:23:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void by_paragraph(int (*read)(void *), void *in, void (*write)(void *, char *), void *out) { data/cgreen-1.3.0/doc/tutorial_src/stream.c:25:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *line = read_paragraph(read, in); data/cgreen-1.3.0/doc/tutorial_src/stream.c:26:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((line == NULL) || (strlen(line) == 0)) { data/cgreen-1.3.0/doc/tutorial_src/stream.h:1:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream); data/cgreen-1.3.0/doc/tutorial_src/stream.h:2:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void by_paragraph(int (*read)(void *), void *in, void (*write)(void *, char *), void *out); data/cgreen-1.3.0/doc/tutorial_src/stream1.c:5:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream) { data/cgreen-1.3.0/doc/tutorial_src/stream1.c:9:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ch = (*read)(stream)) != EOF) { data/cgreen-1.3.0/doc/tutorial_src/stream1.c:23:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void by_paragraph(int (*read)(void *), void *in, void (*write)(void *, char *), void *out) { data/cgreen-1.3.0/doc/tutorial_src/stream1.c:25:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *line = read_paragraph(read, in); data/cgreen-1.3.0/doc/tutorial_src/stream2.c:5:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream) { data/cgreen-1.3.0/doc/tutorial_src/stream2.c:9:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ch = (*read)(stream)) != EOF) { data/cgreen-1.3.0/doc/tutorial_src/stream2.c:23:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void by_paragraph(int (*read)(void *), void *in, void (*write)(void *, char *), void *out) { data/cgreen-1.3.0/doc/tutorial_src/stream2.c:25:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *line = read_paragraph(read, in); data/cgreen-1.3.0/doc/tutorial_src/stream2.c:26:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((line == NULL) || (strlen(line) == 0)) { data/cgreen-1.3.0/doc/tutorial_src/stream_tests0.c:4:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream); data/cgreen-1.3.0/doc/tutorial_src/stream_tests1.c:4:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream); data/cgreen-1.3.0/doc/tutorial_src/stream_tests2.c:4:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream); data/cgreen-1.3.0/doc/tutorial_src/stream_tests3.c:4:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream); data/cgreen-1.3.0/doc/tutorial_src/stream_tests4.c:4:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *read_paragraph(int (*read)(void *), void *stream); data/cgreen-1.3.0/doc/tutorial_src/strlen_tests1.c:9:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_that(strlen("Hello"), is_equal_to(5)); data/cgreen-1.3.0/doc/tutorial_src/strlen_tests2.c:9:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_that(strlen("Hello"), is_equal_to(5)); data/cgreen-1.3.0/doc/tutorial_src/strlen_tests3.c:5:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_that(strlen("Hello"), is_equal_to(5)); data/cgreen-1.3.0/doc/tutorial_src/strlen_tests4.c:6:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int length = strlen(greeting); data/cgreen-1.3.0/doc/tutorial_src/strlen_tests5.c:9:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_that(strlen("Hello"), is_equal_to(5)); data/cgreen-1.3.0/doc/tutorial_src/strlen_tests6.c:9:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_that(strlen("Hiya"), is_equal_to(5)); data/cgreen-1.3.0/doc/tutorial_src/strlen_tests7.c:9:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_that(strlen("Hiya"), is_equal_to(5)); data/cgreen-1.3.0/doc/tutorial_src/strlen_tests7.c:13:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_equal(strlen("\0"), 0); data/cgreen-1.3.0/doc/tutorial_src/suite_strlen_tests.c:9:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_that(strlen("Hiya"), is_equal_to(5)); data/cgreen-1.3.0/doc/tutorial_src/suite_strlen_tests.c:13:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_equal(strlen("\0"), 0); data/cgreen-1.3.0/doc/tutorial_src/words.c:4:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int i, count = 1, length = strlen(sentence); data/cgreen-1.3.0/doc/tutorial_src/words.c:20:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). word = word + strlen(word) + 1; data/cgreen-1.3.0/doc/tutorial_src/words2.c:5:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (i = 0; i < strlen(sentence); i++) { data/cgreen-1.3.0/doc/tutorial_src/words3.c:5:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (i = 0; i < strlen(sentence); i++) { data/cgreen-1.3.0/doc/tutorial_src/words4.c:4:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int i, count = 1, length = strlen(sentence); data/cgreen-1.3.0/doc/tutorial_src/words5.c:4:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int i, count = 1, length = strlen(sentence); data/cgreen-1.3.0/doc/tutorial_src/words6.c:4:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int i, count = 1, length = strlen(sentence); data/cgreen-1.3.0/doc/tutorial_src/words7.c:5:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int i, count = 1, length = strlen(sentence); data/cgreen-1.3.0/doc/tutorial_src/words7.c:21:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). word = word + strlen(word) + 1; data/cgreen-1.3.0/doc/tutorial_src/words_tests2.c:20:64: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int comparison = memcmp("Birds\0of\0a\0feather", sentence, strlen(sentence)); data/cgreen-1.3.0/doc/tutorial_src/words_tests3.c:21:64: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int comparison = memcmp("Birds\0of\0a\0feather", sentence, strlen(sentence)); data/cgreen-1.3.0/doc/tutorial_src/words_tests4.c:21:64: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int comparison = memcmp("Birds\0of\0a\0feather", sentence, strlen(sentence)); data/cgreen-1.3.0/src/cdash_reporter.c:349:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(strtime, s, i+1); data/cgreen-1.3.0/src/cgreen_value.c:11:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strcpy((char *)malloc(strlen(string)+1), string); data/cgreen-1.3.0/src/constraint.c:610:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(actual.value.string_value) - strlen(constraint->expected_value.value.string_value); data/cgreen-1.3.0/src/constraint.c:610:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(actual.value.string_value) - strlen(constraint->expected_value.value.string_value); data/cgreen-1.3.0/src/constraint.c:615:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(actual.value.string_value) - strlen(constraint->expected_value.value.string_value); data/cgreen-1.3.0/src/constraint.c:615:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(actual.value.string_value) - strlen(constraint->expected_value.value.string_value); data/cgreen-1.3.0/src/constraint.c:698:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strlen(constraint->expected_value_message) == 0; data/cgreen-1.3.0/src/message_formatting.c:61:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *new_string = (char *)malloc(strlen(original) + percent_count + 1); data/cgreen-1.3.0/src/message_formatting.c:94:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bool not_valid = (strlen(message) > 0); data/cgreen-1.3.0/src/message_formatting.c:115:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t message_size = strlen(name_has_incorrect_size_message) + data/cgreen-1.3.0/src/message_formatting.c:116:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(null_used_for_compare_message) + data/cgreen-1.3.0/src/message_formatting.c:117:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(null_used_for_actual_message) + data/cgreen-1.3.0/src/message_formatting.c:139:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:139:64: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:148:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:148:64: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:156:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:156:64: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:182:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t message_size = strlen(constraint_as_string_format) + data/cgreen-1.3.0/src/message_formatting.c:183:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(expected_value_string_format) + data/cgreen-1.3.0/src/message_formatting.c:184:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(actual_value_string_format) + data/cgreen-1.3.0/src/message_formatting.c:185:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(at_offset) + data/cgreen-1.3.0/src/message_formatting.c:186:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(constraint->actual_value_message) + data/cgreen-1.3.0/src/message_formatting.c:187:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(constraint->expected_value_message) + data/cgreen-1.3.0/src/message_formatting.c:188:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(constraint->expected_value_name) + data/cgreen-1.3.0/src/message_formatting.c:189:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(constraint->name) + data/cgreen-1.3.0/src/message_formatting.c:190:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(actual_string) + data/cgreen-1.3.0/src/message_formatting.c:196:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). message_size += strlen(constraint->expected_value.value.string_value); data/cgreen-1.3.0/src/message_formatting.c:198:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). message_size += strlen((char *)actual_value); data/cgreen-1.3.0/src/message_formatting.c:219:9: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(message, " "); data/cgreen-1.3.0/src/message_formatting.c:222:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:222:56: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:235:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:235:60: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:239:13: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(message, "\n"); data/cgreen-1.3.0/src/message_formatting.c:240:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:240:64: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:261:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:261:64: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:264:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:264:64: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:273:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:273:56: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:279:9: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(message, "\n"); data/cgreen-1.3.0/src/message_formatting.c:280:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/message_formatting.c:280:60: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(message + strlen(message), message_size - strlen(message) - 1, data/cgreen-1.3.0/src/mocks.c:96:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(parameter_list) == 0) return 0; data/cgreen-1.3.0/src/parameters.c:16:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strcpy((char *)malloc(strlen(string)+1), string); data/cgreen-1.3.0/src/parameters.c:25:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((parameters == NULL) || (strlen(parameters) == 0)) { data/cgreen-1.3.0/src/parameters.c:34:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). parameters_end = parameters_to_tokenize + strlen(parameters_to_tokenize); data/cgreen-1.3.0/src/parameters.c:37:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). while (token < tokens + strlen(parameters)) { data/cgreen-1.3.0/src/parameters.c:39:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int length_of_token = strlen(token); data/cgreen-1.3.0/src/parameters.c:64:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((parameters == NULL) || (strlen(parameters) == 0)) { data/cgreen-1.3.0/src/parameters.c:73:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). parameters_end = parameters_to_tokenize + strlen(parameters_to_tokenize); data/cgreen-1.3.0/src/parameters.c:76:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). while (token < tokens + strlen(parameters)) { data/cgreen-1.3.0/src/parameters.c:78:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int length_of_token = strlen(token); data/cgreen-1.3.0/src/parameters.c:95:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (i = 0, length = strlen(list); i < length; i++) { data/cgreen-1.3.0/src/parameters.c:113:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return token + strlen(token); data/cgreen-1.3.0/src/parameters.c:121:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strncmp(beginning, token, strlen(beginning)) == 0; data/cgreen-1.3.0/src/parameters.c:125:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memmove(token, token + strlen(function_name) + strlen("("), parameter_length+strlen(")")+1); data/cgreen-1.3.0/src/parameters.c:125:52: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memmove(token, token + strlen(function_name) + strlen("("), parameter_length+strlen(")")+1); data/cgreen-1.3.0/src/parameters.c:125:82: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memmove(token, token + strlen(function_name) + strlen("("), parameter_length+strlen(")")+1); data/cgreen-1.3.0/src/parameters.c:130:52: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (begins_with(token, function_name) && token[strlen(function_name)] == '(' && last_char_of(token) == ')') { data/cgreen-1.3.0/src/parameters.c:131:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int parameter_length = strlen(token) - strlen(function_name) - strlen("()"); data/cgreen-1.3.0/src/parameters.c:131:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int parameter_length = strlen(token) - strlen(function_name) - strlen("()"); data/cgreen-1.3.0/src/parameters.c:131:72: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int parameter_length = strlen(token) - strlen(function_name) - strlen("()"); data/cgreen-1.3.0/src/posix_cgreen_pipe.c:54:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(p, buf, count); data/cgreen-1.3.0/src/text_reporter.c:168:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (buf[strlen(buf)-1] != ' ') data/cgreen-1.3.0/src/utils.c:24:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *dup = (char *)malloc(strlen(string)+1); data/cgreen-1.3.0/src/utils.c:47:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vsprintf(&buffer[strlen(buffer)], fmt, args); data/cgreen-1.3.0/src/xml_reporter.c:104:32: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. if (suite_path[0] != '\0') strcat(suite_path, "-"); data/cgreen-1.3.0/src/xml_reporter.c:105:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(suite_path, segment, sizeof(suite_path)-strlen(suite_path)-1); data/cgreen-1.3.0/src/xml_reporter.c:105:53: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(suite_path, segment, sizeof(suite_path)-strlen(suite_path)-1); data/cgreen-1.3.0/src/xml_reporter.c:110:9: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(suite_path, "-"); data/cgreen-1.3.0/src/xml_reporter.c:111:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(suite_path, suite_name, sizeof(suite_path)-strlen(suite_path)-1); data/cgreen-1.3.0/src/xml_reporter.c:111:56: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(suite_path, suite_name, sizeof(suite_path)-strlen(suite_path)-1); data/cgreen-1.3.0/src/xml_reporter.c:178:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *result = realloc(head, strlen(head)+strlen(tail)+1); data/cgreen-1.3.0/src/xml_reporter.c:178:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *result = realloc(head, strlen(head)+strlen(tail)+1); data/cgreen-1.3.0/src/xml_reporter.c:248:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (output && strlen(output) == 0) { data/cgreen-1.3.0/tests/assertion_messages_tests.c:39:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_that(strlen("%d"), is_equal_to(3)); /* Actually, it's not but should preserve '%' */ data/cgreen-1.3.0/tests/cdash_reporter_tests.c:29:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). output = (char *) realloc(output, strlen(output)+strlen(buffer)+1); data/cgreen-1.3.0/tests/cdash_reporter_tests.c:29:54: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). output = (char *) realloc(output, strlen(output)+strlen(buffer)+1); data/cgreen-1.3.0/tests/cdash_reporter_tests.c:41:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strlen(output); data/cgreen-1.3.0/tests/cute_reporter_tests.c:31:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). output = (char *) realloc(output, strlen(output)+strlen(buffer)+1); data/cgreen-1.3.0/tests/cute_reporter_tests.c:31:54: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). output = (char *) realloc(output, strlen(output)+strlen(buffer)+1); data/cgreen-1.3.0/tests/cute_reporter_tests.c:42:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strlen(output); data/cgreen-1.3.0/tests/cute_reporter_tests.c:84:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_that(strlen(output), is_equal_to(0)); data/cgreen-1.3.0/tests/text_reporter_tests.c:32:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). output = (char *) realloc(output, strlen(output)+strlen(buffer)+1); data/cgreen-1.3.0/tests/text_reporter_tests.c:32:54: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). output = (char *) realloc(output, strlen(output)+strlen(buffer)+1); data/cgreen-1.3.0/tests/text_reporter_tests.c:43:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strlen(output); data/cgreen-1.3.0/tests/xml_reporter_tests.c:31:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). output = (char *) realloc(output, strlen(output)+strlen(buffer)+1); data/cgreen-1.3.0/tests/xml_reporter_tests.c:31:54: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). output = (char *) realloc(output, strlen(output)+strlen(buffer)+1); data/cgreen-1.3.0/tests/xml_reporter_tests.c:53:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strlen(output); data/cgreen-1.3.0/tests/xml_reporter_tests.c:110:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_that(strlen(output), is_equal_to(0)); data/cgreen-1.3.0/tools/discoverer.c:29:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return line[strlen(line)-1] == '\n'; data/cgreen-1.3.0/tools/discoverer.c:34:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (name[strlen(name)-1] == '\n') data/cgreen-1.3.0/tools/discoverer.c:35:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). name[strlen(name)-1] = '\0'; data/cgreen-1.3.0/tools/discoverer_unit_tests.c:50:61: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). will_set_contents_of_parameter(buffer, line, strlen(line)+1), data/cgreen-1.3.0/tools/discoverer_unit_tests.c:51:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). will_return(strlen(line)+1)); data/cgreen-1.3.0/tools/gopt.c:45:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t full_len = strlen (options[i].long_name); data/cgreen-1.3.0/tools/io.c:33:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return result==NULL? EOF : (signed)strlen(result); data/cgreen-1.3.0/tools/runner.c:270:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *tmp = malloc(strlen(file_path)+3); data/cgreen-1.3.0/tools/test_item.c:16:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strstr(start, CGREEN_SEPARATOR)+strlen(CGREEN_SEPARATOR); data/cgreen-1.3.0/tools/test_item.c:20:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return &string[strlen(CGREEN_SPEC_PREFIX CGREEN_SEPARATOR)]; data/cgreen-1.3.0/tools/test_item.c:39:52: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return string_copy_of(start, end? end : &start[strlen(start)]); ANALYSIS SUMMARY: Hits = 304 Lines analyzed = 15618 in approximately 0.52 seconds (30261 lines/second) Physical Source Lines of Code (SLOC) = 11685 Hits@level = [0] 128 [1] 158 [2] 70 [3] 10 [4] 66 [5] 0 Hits@level+ = [0+] 432 [1+] 304 [2+] 146 [3+] 76 [4+] 66 [5+] 0 Hits/KSLOC@level+ = [0+] 36.9705 [1+] 26.0163 [2+] 12.4947 [3+] 6.50407 [4+] 5.64827 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.