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/graphene-1.10.2/include/graphene-box.h Examining data/graphene-1.10.2/include/graphene-euler.h Examining data/graphene-1.10.2/include/graphene-frustum.h Examining data/graphene-1.10.2/include/graphene-gobject.h Examining data/graphene-1.10.2/include/graphene-macros.h Examining data/graphene-1.10.2/include/graphene-matrix.h Examining data/graphene-1.10.2/include/graphene-plane.h Examining data/graphene-1.10.2/include/graphene-point.h Examining data/graphene-1.10.2/include/graphene-point3d.h Examining data/graphene-1.10.2/include/graphene-quad.h Examining data/graphene-1.10.2/include/graphene-quaternion.h Examining data/graphene-1.10.2/include/graphene-ray.h Examining data/graphene-1.10.2/include/graphene-rect.h Examining data/graphene-1.10.2/include/graphene-simd4f.h Examining data/graphene-1.10.2/include/graphene-simd4x4f.h Examining data/graphene-1.10.2/include/graphene-size.h Examining data/graphene-1.10.2/include/graphene-sphere.h Examining data/graphene-1.10.2/include/graphene-triangle.h Examining data/graphene-1.10.2/include/graphene-types.h Examining data/graphene-1.10.2/include/graphene-vec2.h Examining data/graphene-1.10.2/include/graphene-vec3.h Examining data/graphene-1.10.2/include/graphene-vec4.h Examining data/graphene-1.10.2/include/graphene-version-macros.h Examining data/graphene-1.10.2/include/graphene.h Examining data/graphene-1.10.2/src/graphene-alloc-private.h Examining data/graphene-1.10.2/src/graphene-alloc.c Examining data/graphene-1.10.2/src/graphene-box.c Examining data/graphene-1.10.2/src/graphene-euler.c Examining data/graphene-1.10.2/src/graphene-frustum.c Examining data/graphene-1.10.2/src/graphene-gobject.c Examining data/graphene-1.10.2/src/graphene-line-segment-private.h Examining data/graphene-1.10.2/src/graphene-matrix.c Examining data/graphene-1.10.2/src/graphene-plane.c Examining data/graphene-1.10.2/src/graphene-point.c Examining data/graphene-1.10.2/src/graphene-point3d.c Examining data/graphene-1.10.2/src/graphene-private.h Examining data/graphene-1.10.2/src/graphene-quad.c Examining data/graphene-1.10.2/src/graphene-quaternion.c Examining data/graphene-1.10.2/src/graphene-ray.c Examining data/graphene-1.10.2/src/graphene-rect.c Examining data/graphene-1.10.2/src/graphene-simd4f.c Examining data/graphene-1.10.2/src/graphene-simd4x4f.c Examining data/graphene-1.10.2/src/graphene-size.c Examining data/graphene-1.10.2/src/graphene-sphere.c Examining data/graphene-1.10.2/src/graphene-triangle.c Examining data/graphene-1.10.2/src/graphene-vectors-private.h Examining data/graphene-1.10.2/src/graphene-vectors.c Examining data/graphene-1.10.2/subprojects/mutest/include/mutest.h Examining data/graphene-1.10.2/subprojects/mutest/src/mutest-expect.c Examining data/graphene-1.10.2/subprojects/mutest/src/mutest-format-mocha.c Examining data/graphene-1.10.2/subprojects/mutest/src/mutest-format-tap.c Examining data/graphene-1.10.2/subprojects/mutest/src/mutest-main.c Examining data/graphene-1.10.2/subprojects/mutest/src/mutest-matchers.c Examining data/graphene-1.10.2/subprojects/mutest/src/mutest-private.h Examining data/graphene-1.10.2/subprojects/mutest/src/mutest-spec.c Examining data/graphene-1.10.2/subprojects/mutest/src/mutest-suite.c Examining data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c Examining data/graphene-1.10.2/subprojects/mutest/src/mutest-wrappers.c Examining data/graphene-1.10.2/subprojects/mutest/tests/general.c Examining data/graphene-1.10.2/subprojects/mutest/tests/hooks.c Examining data/graphene-1.10.2/subprojects/mutest/tests/types.c Examining data/graphene-1.10.2/tests/box.c Examining data/graphene-1.10.2/tests/euler.c Examining data/graphene-1.10.2/tests/frustum.c Examining data/graphene-1.10.2/tests/matrix.c Examining data/graphene-1.10.2/tests/plane.c Examining data/graphene-1.10.2/tests/point.c Examining data/graphene-1.10.2/tests/point3d.c Examining data/graphene-1.10.2/tests/quad.c Examining data/graphene-1.10.2/tests/quaternion.c Examining data/graphene-1.10.2/tests/ray.c Examining data/graphene-1.10.2/tests/rect.c Examining data/graphene-1.10.2/tests/simd.c Examining data/graphene-1.10.2/tests/size.c Examining data/graphene-1.10.2/tests/sphere.c Examining data/graphene-1.10.2/tests/triangle.c Examining data/graphene-1.10.2/tests/vec2.c Examining data/graphene-1.10.2/tests/vec3.c Examining data/graphene-1.10.2/tests/vec4.c FINAL RESULTS: data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c:188:25: [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 mutest_strdup (getenv (str)); data/graphene-1.10.2/tests/matrix.c:368:23: [3] (random) g_random_double_range: 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. g_random_double_range (-10000, 10000), data/graphene-1.10.2/tests/matrix.c:369:23: [3] (random) g_random_double_range: 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. g_random_double_range (-10000, 10000), data/graphene-1.10.2/tests/matrix.c:370:23: [3] (random) g_random_double_range: 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. g_random_double_range (-10000, 10000)); data/graphene-1.10.2/tests/matrix.c:373:23: [3] (random) g_random_double_range: 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. g_random_double_range (-10000, 10000), data/graphene-1.10.2/tests/matrix.c:374:23: [3] (random) g_random_double_range: 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. g_random_double_range (-10000, 10000), data/graphene-1.10.2/tests/matrix.c:375:23: [3] (random) g_random_double_range: 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. g_random_double_range (-10000, 10000)); data/graphene-1.10.2/tests/matrix.c:378:23: [3] (random) g_random_double_range: 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. g_random_double_range (-1, 1), data/graphene-1.10.2/tests/matrix.c:379:23: [3] (random) g_random_double_range: 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. g_random_double_range (-1, 1), data/graphene-1.10.2/tests/matrix.c:380:23: [3] (random) g_random_double_range: 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. g_random_double_range (-1, 1)); data/graphene-1.10.2/include/graphene-simd4f.h:224: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 ((v), &(s), sizeof (float) * 3); \ data/graphene-1.10.2/include/graphene-simd4f.h:229: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 ((v), &(s), sizeof (float) * 2); \ data/graphene-1.10.2/include/graphene-simd4f.h:500:3: [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 (v, &s, sizeof (float) * 3) data/graphene-1.10.2/include/graphene-simd4f.h:503:3: [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 (v, &s, sizeof (float) * 2) data/graphene-1.10.2/include/graphene-simd4f.h:809: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 ((v), &(s), sizeof (float) * 4); \ data/graphene-1.10.2/include/graphene-simd4f.h:814: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 ((v), &(s), sizeof (float) * 3); \ data/graphene-1.10.2/include/graphene-simd4f.h:819: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 ((v), &(s), sizeof (float) * 2); \ data/graphene-1.10.2/src/graphene-quad.c:143:3: [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 (q->points, points, sizeof (graphene_point_t) * 4); data/graphene-1.10.2/src/graphene-simd4f.c:1082:3: [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 (v, &s, sizeof (float) * 4); data/graphene-1.10.2/src/graphene-simd4f.c:1089:3: [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 (v, &s, sizeof (float) * 3); data/graphene-1.10.2/src/graphene-simd4f.c:1096:3: [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 (v, &s, sizeof (float) * 2); data/graphene-1.10.2/subprojects/mutest/src/mutest-expect.c:447:3: [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 location[256]; data/graphene-1.10.2/subprojects/mutest/src/mutest-expect.c:453:3: [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 lhs[256], rhs[256], comparison[16]; data/graphene-1.10.2/subprojects/mutest/src/mutest-format-mocha.c:147:3: [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 passing_s[128], failing_s[128], skipped_s[128]; data/graphene-1.10.2/subprojects/mutest/src/mutest-format-mocha.c:155:3: [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 delta_s[128]; data/graphene-1.10.2/subprojects/mutest/src/mutest-format-mocha.c:236:3: [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 passing_s[128], failing_s[128], skipped_s[128]; data/graphene-1.10.2/subprojects/mutest/src/mutest-format-mocha.c:244:3: [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 delta_s[128]; data/graphene-1.10.2/subprojects/mutest/src/mutest-format-tap.c:15:3: [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[64]; data/graphene-1.10.2/subprojects/mutest/src/mutest-format-tap.c:88:7: [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 plan[128]; data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c:140:3: [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 (res, str, len); data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c:169:3: [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 (res, str, len * sizeof (char)); data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c:230:3: [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 lstr[32]; data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c:341:7: [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 (line, p, line_len); data/graphene-1.10.2/subprojects/mutest/src/mutest-wrappers.c:310:3: [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 (res->expect.v_bytearray.data, data, total_size); data/graphene-1.10.2/tests/box.c:429:7: [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 desc[128]; data/graphene-1.10.2/tests/triangle.c:300:7: [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 desc[128]; data/graphene-1.10.2/tests/triangle.c:332:7: [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 desc[128]; data/graphene-1.10.2/tests/triangle.c:367:7: [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 desc[128]; data/graphene-1.10.2/src/graphene-alloc.c:112:9: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. res = memalign (alignment, real_size); data/graphene-1.10.2/subprojects/mutest/src/mutest-expect.c:492: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). size_t lhs_len = strlen (lhs); data/graphene-1.10.2/subprojects/mutest/src/mutest-expect.c:493: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). size_t cmp_len = strlen (comparison); data/graphene-1.10.2/subprojects/mutest/src/mutest-expect.c:494: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). size_t rhs_len = strlen (rhs); data/graphene-1.10.2/subprojects/mutest/src/mutest-expect.c:503: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). size_t loc_len = strlen (location); data/graphene-1.10.2/subprojects/mutest/src/mutest-format-mocha.c:39: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). size_t indent_len = strlen (indent_expect ()) + 3; data/graphene-1.10.2/subprojects/mutest/src/mutest-format-mocha.c:101:63: [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). mutest_format_string_for_display (spec->description, ' ', strlen (indent_spec ())); data/graphene-1.10.2/subprojects/mutest/src/mutest-format-mocha.c:121:43: [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 (indent_spec ()) + strlen ("skipped: ")); data/graphene-1.10.2/subprojects/mutest/src/mutest-format-mocha.c:121:69: [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 (indent_spec ()) + strlen ("skipped: ")); data/graphene-1.10.2/subprojects/mutest/src/mutest-format-mocha.c:203: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). 2 + strlen ("skipped: ")); data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c:135:16: [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 len = strlen (str) + 1; data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c:161: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). size_t str_len = strlen (str) + 1; data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c:209:43: [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). write (fileno (stream), fragment, strlen (fragment)); data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c:313: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). size_t remainder = strlen (p); data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c:356:16: [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 len = strlen (lines[0]) + 1; data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c:360: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). len += indent_len + strlen (lines[i]); data/graphene-1.10.2/subprojects/mutest/src/mutest-utils.c:409:37: [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 ((size_t) state->term_width > (strlen (str) + indent_len)) ANALYSIS SUMMARY: Hits = 55 Lines analyzed = 30068 in approximately 0.83 seconds (36264 lines/second) Physical Source Lines of Code (SLOC) = 17435 Hits@level = [0] 50 [1] 17 [2] 28 [3] 10 [4] 0 [5] 0 Hits@level+ = [0+] 105 [1+] 55 [2+] 38 [3+] 10 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 6.02237 [1+] 3.15457 [2+] 2.17952 [3+] 0.573559 [4+] 0 [5+] 0 Dot directories skipped = 5 (--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.