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/python-fisx-1.1.8/python/cython/_fisx.cpp Examining data/python-fisx-1.1.8/python/cython/default/_fisx.cpp Examining data/python-fisx-1.1.8/src/fisx_beam.cpp Examining data/python-fisx-1.1.8/src/fisx_beam.h Examining data/python-fisx-1.1.8/src/fisx_defaultelementsinfo.h Examining data/python-fisx-1.1.8/src/fisx_detector.cpp Examining data/python-fisx-1.1.8/src/fisx_detector.h Examining data/python-fisx-1.1.8/src/fisx_element.cpp Examining data/python-fisx-1.1.8/src/fisx_element.h Examining data/python-fisx-1.1.8/src/fisx_elements.cpp Examining data/python-fisx-1.1.8/src/fisx_elements.h Examining data/python-fisx-1.1.8/src/fisx_epdl97.cpp Examining data/python-fisx-1.1.8/src/fisx_epdl97.h Examining data/python-fisx-1.1.8/src/fisx_layer.cpp Examining data/python-fisx-1.1.8/src/fisx_layer.h Examining data/python-fisx-1.1.8/src/fisx_material.cpp Examining data/python-fisx-1.1.8/src/fisx_material.h Examining data/python-fisx-1.1.8/src/fisx_math.cpp Examining data/python-fisx-1.1.8/src/fisx_math.h Examining data/python-fisx-1.1.8/src/fisx_multilayer.cpp Examining data/python-fisx-1.1.8/src/fisx_shell.cpp Examining data/python-fisx-1.1.8/src/fisx_shell.h Examining data/python-fisx-1.1.8/src/fisx_simpleini.cpp Examining data/python-fisx-1.1.8/src/fisx_simpleini.h Examining data/python-fisx-1.1.8/src/fisx_simplespecfile.cpp Examining data/python-fisx-1.1.8/src/fisx_simplespecfile.h Examining data/python-fisx-1.1.8/src/fisx_version.cpp Examining data/python-fisx-1.1.8/src/fisx_version.h Examining data/python-fisx-1.1.8/src/fisx_xrf.cpp Examining data/python-fisx-1.1.8/src/fisx_xrf.h Examining data/python-fisx-1.1.8/src/fisx_xrfconfig.cpp Examining data/python-fisx-1.1.8/src/fisx_xrfconfig.h FINAL RESULTS: data/python-fisx-1.1.8/python/cython/_fisx.cpp:804: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(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); data/python-fisx-1.1.8/python/cython/default/_fisx.cpp:804: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(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); data/python-fisx-1.1.8/python/cython/_fisx.cpp:32264:18: [3] (random) setstate: 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. if (!setstate) PyErr_Clear(); data/python-fisx-1.1.8/python/cython/_fisx.cpp:32265:18: [3] (random) setstate: 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. if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { data/python-fisx-1.1.8/python/cython/_fisx.cpp:32265:58: [3] (random) setstate: 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. if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { data/python-fisx-1.1.8/python/cython/_fisx.cpp:32286:16: [3] (random) setstate: 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. Py_XDECREF(setstate); data/python-fisx-1.1.8/python/cython/default/_fisx.cpp:32264:18: [3] (random) setstate: 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. if (!setstate) PyErr_Clear(); data/python-fisx-1.1.8/python/cython/default/_fisx.cpp:32265:18: [3] (random) setstate: 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. if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { data/python-fisx-1.1.8/python/cython/default/_fisx.cpp:32265:58: [3] (random) setstate: 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. if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { data/python-fisx-1.1.8/python/cython/default/_fisx.cpp:32286:16: [3] (random) setstate: 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. Py_XDECREF(setstate); data/python-fisx-1.1.8/src/fisx_elements.cpp:46: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. path = std::getenv("FISX_DATA_DIR"); data/python-fisx-1.1.8/python/cython/_fisx.cpp:757: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 ascii_chars[128]; data/python-fisx-1.1.8/python/cython/_fisx.cpp:33440: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 ctversion[4], rtversion[4]; data/python-fisx-1.1.8/python/cython/_fisx.cpp:33444: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 message[200]; data/python-fisx-1.1.8/python/cython/default/_fisx.cpp:757: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 ascii_chars[128]; data/python-fisx-1.1.8/python/cython/default/_fisx.cpp:33440: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 ctversion[4], rtversion[4]; data/python-fisx-1.1.8/python/cython/default/_fisx.cpp:33444: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 message[200]; data/python-fisx-1.1.8/python/cython/_fisx.cpp:681:87: [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). #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) data/python-fisx-1.1.8/python/cython/_fisx.cpp:802: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). __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); data/python-fisx-1.1.8/python/cython/_fisx.cpp:33488:65: [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 __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); data/python-fisx-1.1.8/python/cython/default/_fisx.cpp:681:87: [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). #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) data/python-fisx-1.1.8/python/cython/default/_fisx.cpp:802: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). __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); data/python-fisx-1.1.8/python/cython/default/_fisx.cpp:33488:65: [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 __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); data/python-fisx-1.1.8/src/fisx_elements.cpp:2173:42: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (std::equal(composition.begin(), composition.end(), this->detectorCompositionUsedInCache.begin())) data/python-fisx-1.1.8/src/fisx_shell.cpp:565:18: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (std::equal(destination.rbegin(), destination.rend(), it->first.rbegin())) data/python-fisx-1.1.8/src/fisx_shell.cpp:592:22: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (std::equal(destination.rbegin(), destination.rend(), it->first.rbegin())) data/python-fisx-1.1.8/src/fisx_simpleini.h:142:17: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. && std::equal(testString.begin(), testString.end(), stringToCheck.begin()); ANALYSIS SUMMARY: Hits = 27 Lines analyzed = 79726 in approximately 2.11 seconds (37742 lines/second) Physical Source Lines of Code (SLOC) = 58152 Hits@level = [0] 0 [1] 10 [2] 6 [3] 9 [4] 2 [5] 0 Hits@level+ = [0+] 27 [1+] 27 [2+] 17 [3+] 11 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 0.4643 [1+] 0.4643 [2+] 0.292337 [3+] 0.189159 [4+] 0.0343926 [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.