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/mpi4py-3.0.3/demo/cython/mpi-compat.h Examining data/mpi4py-3.0.3/demo/wrap-c/helloworld.c Examining data/mpi4py-3.0.3/demo/spawning/cpi-master.c Examining data/mpi4py-3.0.3/demo/spawning/cpi-master.cxx Examining data/mpi4py-3.0.3/demo/spawning/cpi-worker.c Examining data/mpi4py-3.0.3/demo/spawning/cpi-worker.cxx Examining data/mpi4py-3.0.3/demo/wrap-cffi/helloworld.c Examining data/mpi4py-3.0.3/demo/helloworld.cxx Examining data/mpi4py-3.0.3/demo/wrap-ctypes/helloworld.c Examining data/mpi4py-3.0.3/demo/helloworld.c Examining data/mpi4py-3.0.3/demo/wrap-cython/mpi-compat.h Examining data/mpi4py-3.0.3/demo/embedding/helloworld.c Examining data/mpi4py-3.0.3/demo/wrap-boost/helloworld.cxx Examining data/mpi4py-3.0.3/src/python.c Examining data/mpi4py-3.0.3/src/pympivendor.h Examining data/mpi4py-3.0.3/src/mpi4py/include/mpi4py/mpi4py.MPI_api.h Examining data/mpi4py-3.0.3/src/mpi4py/include/mpi4py/mpi4py.MPI.h Examining data/mpi4py-3.0.3/src/mpi4py/include/mpi4py/mpi4py.h Examining data/mpi4py-3.0.3/src/lib-mpi/config.h Examining data/mpi4py-3.0.3/src/lib-mpi/compat/mpich3.h Examining data/mpi4py-3.0.3/src/lib-mpi/compat/sicortex.h Examining data/mpi4py-3.0.3/src/lib-mpi/compat/msmpi.h Examining data/mpi4py-3.0.3/src/lib-mpi/compat/lammpi.h Examining data/mpi4py-3.0.3/src/lib-mpi/compat/openmpi.h Examining data/mpi4py-3.0.3/src/lib-mpi/compat/mpich2.h Examining data/mpi4py-3.0.3/src/lib-mpi/compat/pcmpi.h Examining data/mpi4py-3.0.3/src/lib-mpi/compat/mpich1.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/mpi-12.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/mpich3.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/mpi-31.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/unknown.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/mpi-22.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/mpich2-io.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/mpi-20.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/mpich3-io.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/msmpi.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/openmpi.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/openmpi-io.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/mpich2.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/mpi-30.h Examining data/mpi4py-3.0.3/src/lib-mpi/config/mpi-11.h Examining data/mpi4py-3.0.3/src/lib-mpi/fallback.h Examining data/mpi4py-3.0.3/src/lib-mpi/compat.h Examining data/mpi4py-3.0.3/src/lib-mpi/missing.h Examining data/mpi4py-3.0.3/src/pympicommctx.h Examining data/mpi4py-3.0.3/src/lib-pmpi/vt.c Examining data/mpi4py-3.0.3/src/lib-pmpi/vt-hyb.c Examining data/mpi4py-3.0.3/src/lib-pmpi/vt-mpi.c Examining data/mpi4py-3.0.3/src/lib-pmpi/vt.h Examining data/mpi4py-3.0.3/src/lib-pmpi/mpe.c Examining data/mpi4py-3.0.3/src/atimport.h Examining data/mpi4py-3.0.3/src/mpi4py.MPI.c Examining data/mpi4py-3.0.3/src/pycompat.h Examining data/mpi4py-3.0.3/src/msvcfix.h Examining data/mpi4py-3.0.3/src/MPI.c Examining data/mpi4py-3.0.3/src/dynload.h Examining data/mpi4py-3.0.3/src/dynload.c FINAL RESULTS: data/mpi4py-3.0.3/demo/spawning/cpi-master.c:15:17: [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). if (argc > 1) strcpy(cmd, argv[1]); data/mpi4py-3.0.3/demo/spawning/cpi-master.cxx:11:22: [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). if (argc > 1) std::strcpy(cmd, argv[1]); data/mpi4py-3.0.3/src/mpi4py.MPI.c:771: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/mpi4py-3.0.3/demo/helloworld.c:7: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 name[MPI_MAX_PROCESSOR_NAME]; data/mpi4py-3.0.3/demo/helloworld.cxx:14: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. int len; char name[MPI_MAX_PROCESSOR_NAME]; data/mpi4py-3.0.3/demo/spawning/cpi-master.c:8: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 cmd[32] = "./cpi-worker-c.exe"; data/mpi4py-3.0.3/demo/spawning/cpi-master.cxx:10: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 cmd[32] = "./cpi-worker-cxx.exe"; data/mpi4py-3.0.3/demo/wrap-boost/helloworld.cxx:14:13: [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. int plen; char pname[MPI_MAX_PROCESSOR_NAME]; data/mpi4py-3.0.3/demo/wrap-c/helloworld.c:11: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 pname[MPI_MAX_PROCESSOR_NAME]; int len; data/mpi4py-3.0.3/demo/wrap-cffi/helloworld.c:16: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 pname[MPI_MAX_PROCESSOR_NAME]; int len; data/mpi4py-3.0.3/demo/wrap-ctypes/helloworld.c:16: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 pname[MPI_MAX_PROCESSOR_NAME]; int len; data/mpi4py-3.0.3/src/lib-mpi/compat/mpich1.h:7: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 *PyMPI_MPICH1_argv[1] = {(char*)0}; data/mpi4py-3.0.3/src/lib-mpi/compat/mpich2.h:6:13: [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. int ierr; char errstr[1] = {0}; data/mpi4py-3.0.3/src/lib-mpi/compat/mpich2.h:16:13: [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. int ierr; char errstr[1] = {0}; data/mpi4py-3.0.3/src/lib-mpi/compat/mpich3.h:23:13: [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. int ierr; char errstr[1] = {0}; data/mpi4py-3.0.3/src/lib-mpi/compat/mpich3.h:33:13: [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. int ierr; char errstr[1] = {0}; data/mpi4py-3.0.3/src/lib-mpi/compat/msmpi.h:6:13: [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. int ierr; char errstr[1] = {0}; data/mpi4py-3.0.3/src/lib-mpi/compat/msmpi.h:16:13: [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. int ierr; char errstr[1] = {0}; data/mpi4py-3.0.3/src/mpi4py.MPI.c:724: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/mpi4py-3.0.3/src/mpi4py.MPI.c:2474: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 __pyx_v_6mpi4py_3MPI_BYTE_FMT[2]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:13790:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. ((void)memcpy(__pyx_v_q, __pyx_v_p, ((size_t)__pyx_v_n))); data/mpi4py-3.0.3/src/mpi4py.MPI.c:45982:74: [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. __pyx_t_2 = PyBytes_AsString(__pyx_v_buf); if (unlikely(__pyx_t_2 == ((char *)NULL))) __PYX_ERR(6, 105, __pyx_L1_error) data/mpi4py-3.0.3/src/mpi4py.MPI.c:46313:74: [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. __pyx_t_8 = PyBytes_AsString(__pyx_v_buf); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(6, 127, __pyx_L1_error) data/mpi4py-3.0.3/src/mpi4py.MPI.c:46504:74: [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. __pyx_t_2 = PyBytes_AsString(__pyx_v_buf); if (unlikely(__pyx_t_2 == ((char *)NULL))) __PYX_ERR(6, 140, __pyx_L1_error) data/mpi4py-3.0.3/src/mpi4py.MPI.c:64126: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 __pyx_v_string[(MPI_MAX_ERROR_STRING + 1)]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:64370: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 __pyx_v_string[(MPI_MAX_ERROR_STRING + 1)]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:75175: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 __pyx_v_name[(MPI_MAX_OBJECT_NAME + 1)]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:88818: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 __pyx_v_ckey[(MPI_MAX_INFO_KEY + 1)]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:112682: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 __pyx_v_name[(MPI_MAX_OBJECT_NAME + 1)]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:129828: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 __pyx_v_cportname[(MPI_MAX_PORT_NAME + 1)]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:130633: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 __pyx_v_cportname[(MPI_MAX_PORT_NAME + 1)]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:139666: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 __pyx_v_name[(MPI_MAX_OBJECT_NAME + 1)]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:142651: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 __pyx_v_cdatarep[(MPI_MAX_DATAREP_STRING + 1)]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:152162: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 __pyx_v_name[(MPI_MAX_LIBRARY_VERSION_STRING + 1)]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:152248: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 __pyx_v_name[(MPI_MAX_PROCESSOR_NAME + 1)]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:178377: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/mpi4py-3.0.3/src/mpi4py.MPI.c:178381: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/mpi4py-3.0.3/src/mpi4py/include/mpi4py/mpi4py.MPI_api.h:171: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 warning[200]; data/mpi4py-3.0.3/src/mpi4py.MPI.c:648: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/mpi4py-3.0.3/src/mpi4py.MPI.c:769: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/mpi4py-3.0.3/src/mpi4py.MPI.c:1468:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int (*read)(struct __pyx_obj_6mpi4py_3MPI__p_datarep *, void *, MPI_Datatype, int, void *, MPI_Offset); data/mpi4py-3.0.3/src/mpi4py.MPI.c:178462: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)); ANALYSIS SUMMARY: Hits = 42 Lines analyzed = 188210 in approximately 4.85 seconds (38845 lines/second) Physical Source Lines of Code (SLOC) = 107678 Hits@level = [0] 18 [1] 4 [2] 35 [3] 0 [4] 3 [5] 0 Hits@level+ = [0+] 60 [1+] 42 [2+] 38 [3+] 3 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 0.557217 [1+] 0.390052 [2+] 0.352904 [3+] 0.0278608 [4+] 0.0278608 [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.