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/mumps-5.3.5/include/cmumps_c.h Examining data/mumps-5.3.5/include/cmumps_struc.h Examining data/mumps-5.3.5/include/zmumps_c.h Examining data/mumps-5.3.5/include/mumps_c_types.h Examining data/mumps-5.3.5/include/dmumps_struc.h Examining data/mumps-5.3.5/include/dmumps_root.h Examining data/mumps-5.3.5/include/cmumps_root.h Examining data/mumps-5.3.5/include/dmumps_c.h Examining data/mumps-5.3.5/include/smumps_c.h Examining data/mumps-5.3.5/include/zmumps_struc.h Examining data/mumps-5.3.5/include/smumps_root.h Examining data/mumps-5.3.5/include/mumps_compat.h Examining data/mumps-5.3.5/include/smumps_struc.h Examining data/mumps-5.3.5/include/zmumps_root.h Examining data/mumps-5.3.5/SCILAB/intmumpsc.c Examining data/mumps-5.3.5/src/mumps_pord.h Examining data/mumps-5.3.5/src/mumps_scotch.h Examining data/mumps-5.3.5/src/mumps_io_err.h Examining data/mumps-5.3.5/src/mumps_io_thread.c Examining data/mumps-5.3.5/src/smumps_gpu.c Examining data/mumps-5.3.5/src/cmumps_gpu.h Examining data/mumps-5.3.5/src/mumps_thread_affinity.c Examining data/mumps-5.3.5/src/mumps_size.c Examining data/mumps-5.3.5/src/mumps_scotch_int.c Examining data/mumps-5.3.5/src/mumps_scotch.c Examining data/mumps-5.3.5/src/mumps_scotch64.c Examining data/mumps-5.3.5/src/mumps_scotch_int.h Examining data/mumps-5.3.5/src/dmumps_gpu.h Examining data/mumps-5.3.5/src/mumps_io_err.c Examining data/mumps-5.3.5/src/mumps_metis64.h Examining data/mumps-5.3.5/src/mumps_scotch64.h Examining data/mumps-5.3.5/src/zmumps_gpu.h Examining data/mumps-5.3.5/src/mumps_io_basic.h Examining data/mumps-5.3.5/src/mumps_metis.c Examining data/mumps-5.3.5/src/mumps_numa.c Examining data/mumps-5.3.5/src/mumps_io.c Examining data/mumps-5.3.5/src/mumps_common.h Examining data/mumps-5.3.5/src/dmumps_gpu.c Examining data/mumps-5.3.5/src/mumps_io_basic.c Examining data/mumps-5.3.5/src/smumps_gpu.h Examining data/mumps-5.3.5/src/cmumps_gpu.c Examining data/mumps-5.3.5/src/mumps_save_restore_C.c Examining data/mumps-5.3.5/src/mumps_thread_affinity.h Examining data/mumps-5.3.5/src/mumps_metis64.c Examining data/mumps-5.3.5/src/mumps_io_thread.h Examining data/mumps-5.3.5/src/build_mumps_int_def.c Examining data/mumps-5.3.5/src/mumps_io.h Examining data/mumps-5.3.5/src/mumps_metis_int.c Examining data/mumps-5.3.5/src/mumps_config_file_C.h Examining data/mumps-5.3.5/src/mumps_config_file_C.c Examining data/mumps-5.3.5/src/mumps_size.h Examining data/mumps-5.3.5/src/mumps_metis_int.h Examining data/mumps-5.3.5/src/mumps_save_restore_C.h Examining data/mumps-5.3.5/src/mumps_c.c Examining data/mumps-5.3.5/src/mumps_thread.c Examining data/mumps-5.3.5/src/mumps_headers.h Examining data/mumps-5.3.5/src/mumps_pord.c Examining data/mumps-5.3.5/src/zmumps_gpu.c Examining data/mumps-5.3.5/src/mumps_common.c Examining data/mumps-5.3.5/src/mumps_tags.h Examining data/mumps-5.3.5/src/mumps_metis.h Examining data/mumps-5.3.5/libseq/elapse.h Examining data/mumps-5.3.5/libseq/elapse.c Examining data/mumps-5.3.5/libseq/mpic.c Examining data/mumps-5.3.5/libseq/mpif.h Examining data/mumps-5.3.5/libseq/mpi.h Examining data/mumps-5.3.5/MATLAB/mumpsmex.c Examining data/mumps-5.3.5/examples/c_example_save_restore.c Examining data/mumps-5.3.5/examples/c_example.c Examining data/mumps-5.3.5/PORD/include/types.h Examining data/mumps-5.3.5/PORD/include/macros.h Examining data/mumps-5.3.5/PORD/include/const.h Examining data/mumps-5.3.5/PORD/include/protos.h Examining data/mumps-5.3.5/PORD/include/params.h Examining data/mumps-5.3.5/PORD/include/eval.h Examining data/mumps-5.3.5/PORD/include/space.h Examining data/mumps-5.3.5/PORD/lib/gelim.c Examining data/mumps-5.3.5/PORD/lib/nestdiss.c Examining data/mumps-5.3.5/PORD/lib/minpriority.c Examining data/mumps-5.3.5/PORD/lib/bucket.c Examining data/mumps-5.3.5/PORD/lib/gbisect.c Examining data/mumps-5.3.5/PORD/lib/ddcreate.c Examining data/mumps-5.3.5/PORD/lib/interface.c Examining data/mumps-5.3.5/PORD/lib/gbipart.c Examining data/mumps-5.3.5/PORD/lib/sort.c Examining data/mumps-5.3.5/PORD/lib/symbfac.c Examining data/mumps-5.3.5/PORD/lib/tree.c Examining data/mumps-5.3.5/PORD/lib/multisector.c Examining data/mumps-5.3.5/PORD/lib/graph.c Examining data/mumps-5.3.5/PORD/lib/ddbisect.c FINAL RESULTS: data/mumps-5.3.5/PORD/include/macros.h:53:59: [5] (buffer) gets: Does not check for buffer overflows (CWE-120, CWE-20). Use fgets() instead. { char _s[MAX_LINE_LEN]; printf("\n<RETURN>"); gets(_s); } data/mumps-5.3.5/include/cmumps_root.h:33:17: [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. ! Used to access Schur easily from root structure data/mumps-5.3.5/include/dmumps_root.h:33:17: [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. ! Used to access Schur easily from root structure data/mumps-5.3.5/include/smumps_root.h:33:17: [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. ! Used to access Schur easily from root structure data/mumps-5.3.5/include/zmumps_root.h:33:17: [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. ! Used to access Schur easily from root structure data/mumps-5.3.5/src/mumps_io.c:577:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf,"Unable to remove OOC file %s",name); data/mumps-5.3.5/src/mumps_io.c:579:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf,"Unable to remove OOC file %s with return value %d",name,*ierr); data/mumps-5.3.5/src/mumps_io_basic.c:98:3: [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(name,mumps_ooc_file_prefix); data/mumps-5.3.5/src/mumps_io_basic.c:112:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name,"%s_%d_%d",mumps_ooc_file_prefix,((mumps_files+type)->mumps_io_current_file_number)+1,type); data/mumps-5.3.5/src/mumps_io_basic.c:120:3: [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((mumps_io_pfile_pointer_array+(mumps_files+type)->mumps_io_current_file_number)->name,name); data/mumps-5.3.5/src/mumps_io_basic.c:567:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(base_name,"_%s%d_XXXXXX",mumps_base,*_myid); data/mumps-5.3.5/src/mumps_io_basic.c:569:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(base_name,"_%s%d",mumps_base,*_myid); data/mumps-5.3.5/src/mumps_io_basic.c:575:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(mumps_ooc_file_prefix,"%s%s%s%s",tmp_dir,SEPARATOR,tmp_fname,base_name); data/mumps-5.3.5/src/mumps_io_basic.c:578:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(base_name,"%s%s%d_XXXXXX",SEPARATOR,mumps_base,*_myid); data/mumps-5.3.5/src/mumps_io_basic.c:580:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(base_name,"%s%s%d",SEPARATOR,mumps_base,*_myid); data/mumps-5.3.5/src/mumps_io_basic.c:586:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(mumps_ooc_file_prefix,"%s%s%s",tmp_dir,SEPARATOR,base_name); data/mumps-5.3.5/src/mumps_io_basic.c:603:3: [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(name,(((mumps_files+*type)->mumps_io_pfile_pointer_array)+i)->name); data/mumps-5.3.5/src/mumps_io_basic.c:656:3: [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((((mumps_files+*type)->mumps_io_pfile_pointer_array)+i)->name,name); data/mumps-5.3.5/src/mumps_io_err.c:132:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(mumps_err, "%s", _err); data/mumps-5.3.5/src/mumps_io_err.c:144:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(mumps_err, "%s: %s", _desc, _err); data/mumps-5.3.5/PORD/include/macros.h:44:12: [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. srand((PORD_INT)time(0) % 10000); data/mumps-5.3.5/src/mumps_io_basic.c:544:13: [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. tmp_dir=getenv("MUMPS_OOC_TMPDIR"); data/mumps-5.3.5/src/mumps_io_basic.c:548:15: [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. tmp_dir=getenv("TMPDIR"); data/mumps-5.3.5/src/mumps_io_basic.c:562:15: [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. tmp_fname=getenv("MUMPS_OOC_PREFIX"); data/mumps-5.3.5/src/mumps_save_restore_C.c:26:18: [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. tmp_save_dir = getenv ("MUMPS_SAVE_DIR"); data/mumps-5.3.5/src/mumps_save_restore_C.c:38:21: [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. tmp_save_prefix = getenv ("MUMPS_SAVE_PREFIX"); data/mumps-5.3.5/PORD/include/macros.h:53: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. { char _s[MAX_LINE_LEN]; printf("\n<RETURN>"); gets(_s); } data/mumps-5.3.5/examples/c_example_save_restore.c:83:3: [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(id_save.save_prefix,"csave_restore"); data/mumps-5.3.5/examples/c_example_save_restore.c:84:3: [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(id_save.save_dir,"/tmp"); data/mumps-5.3.5/examples/c_example_save_restore.c:125:5: [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(id_restore.save_prefix,"csave_restore"); data/mumps-5.3.5/examples/c_example_save_restore.c:126:5: [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(id_restore.save_dir,"/tmp"); data/mumps-5.3.5/include/cmumps_c.h:118: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 version_number[MUMPS_VERSION_MAX_LEN + 1 + 1]; data/mumps-5.3.5/include/cmumps_c.h:120: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 ooc_tmpdir[256]; data/mumps-5.3.5/include/cmumps_c.h:121: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 ooc_prefix[64]; data/mumps-5.3.5/include/cmumps_c.h:123: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 write_problem[256]; data/mumps-5.3.5/include/cmumps_c.h:126: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 save_dir[256]; data/mumps-5.3.5/include/cmumps_c.h:127: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 save_prefix[256]; data/mumps-5.3.5/include/dmumps_c.h:118: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 version_number[MUMPS_VERSION_MAX_LEN + 1 + 1]; data/mumps-5.3.5/include/dmumps_c.h:120: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 ooc_tmpdir[256]; data/mumps-5.3.5/include/dmumps_c.h:121: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 ooc_prefix[64]; data/mumps-5.3.5/include/dmumps_c.h:123: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 write_problem[256]; data/mumps-5.3.5/include/dmumps_c.h:126: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 save_dir[256]; data/mumps-5.3.5/include/dmumps_c.h:127: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 save_prefix[256]; data/mumps-5.3.5/include/smumps_c.h:118: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 version_number[MUMPS_VERSION_MAX_LEN + 1 + 1]; data/mumps-5.3.5/include/smumps_c.h:120: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 ooc_tmpdir[256]; data/mumps-5.3.5/include/smumps_c.h:121: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 ooc_prefix[64]; data/mumps-5.3.5/include/smumps_c.h:123: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 write_problem[256]; data/mumps-5.3.5/include/smumps_c.h:126: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 save_dir[256]; data/mumps-5.3.5/include/smumps_c.h:127: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 save_prefix[256]; data/mumps-5.3.5/include/zmumps_c.h:118: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 version_number[MUMPS_VERSION_MAX_LEN + 1 + 1]; data/mumps-5.3.5/include/zmumps_c.h:120: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 ooc_tmpdir[256]; data/mumps-5.3.5/include/zmumps_c.h:121: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 ooc_prefix[64]; data/mumps-5.3.5/include/zmumps_c.h:123: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 write_problem[256]; data/mumps-5.3.5/include/zmumps_c.h:126: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 save_dir[256]; data/mumps-5.3.5/include/zmumps_c.h:127: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 save_prefix[256]; data/mumps-5.3.5/src/mumps_c.c:340: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(mumps_par->ooc_tmpdir,"NAME_NOT_INITIALIZED"); data/mumps-5.3.5/src/mumps_c.c:341: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(mumps_par->ooc_prefix,"NAME_NOT_INITIALIZED"); data/mumps-5.3.5/src/mumps_c.c:342: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(mumps_par->write_problem,"NAME_NOT_INITIALIZED"); data/mumps-5.3.5/src/mumps_c.c:343: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(mumps_par->save_dir,"NAME_NOT_INITIALIZED"); data/mumps-5.3.5/src/mumps_c.c:344: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(mumps_par->save_prefix,"NAME_NOT_INITIALIZED"); data/mumps-5.3.5/src/mumps_io.c:37: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]; /* for error message */ data/mumps-5.3.5/src/mumps_io.c:61: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(buf,"Error: unknown I/O strategy : %d\n",mumps_io_flag_async); data/mumps-5.3.5/src/mumps_io.c:75: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]; /* for error message */ data/mumps-5.3.5/src/mumps_io.c:95: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(buf,"Error: unknown I/O strategy : %d\n",mumps_io_flag_async); data/mumps-5.3.5/src/mumps_io.c:149: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[128]; /* for error message */ data/mumps-5.3.5/src/mumps_io.c:230:7: [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(buf,"Error: unknown I/O strategy : %d\n",(MUMPS_INT)*async); data/mumps-5.3.5/src/mumps_io.c:255: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]; /* for error message */ data/mumps-5.3.5/src/mumps_io.c:287:7: [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(buf,"Error: unknown I/O strategy : %d\n",(MUMPS_INT)*strat_IO); data/mumps-5.3.5/src/mumps_io.c:320: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]; /* for error message */ data/mumps-5.3.5/src/mumps_io.c:345:9: [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(buf,"Error: unknown I/O strategy : %d\n",(MUMPS_INT)*strat_IO); data/mumps-5.3.5/src/mumps_io.c:407: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]; /* for error message */ data/mumps-5.3.5/src/mumps_io.c:425: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(buf,"Error: unknown I/O strategy : %d\n",mumps_io_flag_async); data/mumps-5.3.5/src/mumps_io.c:448: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]; /* for error message */ data/mumps-5.3.5/src/mumps_io.c:461: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(buf,"Error: unknown I/O strategy : %d\n",mumps_io_flag_async); data/mumps-5.3.5/src/mumps_io.c:539: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]; /* for error message */ data/mumps-5.3.5/src/mumps_io.c:562:7: [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(buf,"Error: unknown I/O strategy : %d\n",mumps_io_flag_async); data/mumps-5.3.5/src/mumps_io.c:573: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[256]; /* for error message, count 256 chars for name */ data/mumps-5.3.5/src/mumps_io.h:31: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 MUMPS_OOC_STORE_PREFIX[MUMPS_OOC_PREFIX_MAX_LENGTH]; data/mumps-5.3.5/src/mumps_io.h:33: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 MUMPS_OOC_STORE_TMPDIR[MUMPS_OOC_TMPDIR_MAX_LENGTH]; data/mumps-5.3.5/src/mumps_io_basic.c:54: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[351]; data/mumps-5.3.5/src/mumps_io_basic.c:57: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]; /* for error message */ data/mumps-5.3.5/src/mumps_io_basic.c:99:6: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd=mkstemp(name); data/mumps-5.3.5/src/mumps_io_basic.c:106: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(buf,"File creation failure"); data/mumps-5.3.5/src/mumps_io_basic.c:123:89: [2] (misc) open: 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). (mumps_io_pfile_pointer_array+(mumps_files+type)->mumps_io_current_file_number)->file=open(name,(mumps_files+type)->mumps_flag_open,0666); data/mumps-5.3.5/src/mumps_io_basic.c:131:89: [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). (mumps_io_pfile_pointer_array+(mumps_files+type)->mumps_io_current_file_number)->file=fopen(name,(mumps_files+type)->mumps_flag_open); data/mumps-5.3.5/src/mumps_io_basic.c:217: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/mumps-5.3.5/src/mumps_io_basic.c:298: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(buf,"Internal (1) error in low-level I/O operation %lf",to_be_written); data/mumps-5.3.5/src/mumps_io_basic.c:478:7: [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((mumps_files+i)->mumps_flag_open,"wb"); data/mumps-5.3.5/src/mumps_io_basic.c:489:7: [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((mumps_files+i)->mumps_flag_open,"rb"); data/mumps-5.3.5/src/mumps_io_basic.c:500:7: [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((mumps_files+i)->mumps_flag_open,"rwb"); data/mumps-5.3.5/src/mumps_io_basic.c:522: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 base_name[20]; data/mumps-5.3.5/src/mumps_io_basic.c:524: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 mumps_base[10]="mumps_"; data/mumps-5.3.5/src/mumps_io_basic.c:640:5: [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((mumps_files+i)->mumps_flag_open,"rb"); data/mumps-5.3.5/src/mumps_io_basic.c:669:46: [2] (misc) open: 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). (mumps_io_pfile_pointer_array+i)->file=open((mumps_io_pfile_pointer_array+i)->name,(mumps_files+j)->mumps_flag_open); data/mumps-5.3.5/src/mumps_io_basic.c:674:46: [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). (mumps_io_pfile_pointer_array+i)->file=fopen((mumps_io_pfile_pointer_array+i)->name,(mumps_files+j)->mumps_flag_open); data/mumps-5.3.5/src/mumps_io_basic.h:88: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[351]; /* Should be large enough to hold tmpdir, prefix, suffix */ data/mumps-5.3.5/src/mumps_io_basic.h:94: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 mumps_flag_open[6]; data/mumps-5.3.5/src/mumps_io_thread.c:293: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[128]; data/mumps-5.3.5/src/mumps_io_thread.c:312: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(buf,"Internal error: mumps_low_level_init_ooc_c_th should not to be called with strat_IO=%d\n",*async); data/mumps-5.3.5/src/mumps_io_thread.c:349:9: [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(buf,"Internal error: mumps_low_level_init_ooc_c_th should not to be called with strat_IO=%d\n",*async); data/mumps-5.3.5/src/mumps_c.c:345:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(mumps_par->version_number,MUMPS_VERSION,MUMPS_VERSION_MAX_LEN); data/mumps-5.3.5/src/mumps_c.c:353: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). ooc_tmpdirlen=(int)strlen(mumps_par->ooc_tmpdir); data/mumps-5.3.5/src/mumps_c.c:354: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). ooc_prefixlen=(int)strlen(mumps_par->ooc_prefix); data/mumps-5.3.5/src/mumps_c.c:355: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). write_problemlen=(int)strlen(mumps_par->write_problem); data/mumps-5.3.5/src/mumps_c.c:356: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). save_dirlen =(int)strlen(mumps_par->save_dir); data/mumps-5.3.5/src/mumps_c.c:357: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). save_prefixlen=(int)strlen(mumps_par->save_prefix); data/mumps-5.3.5/src/mumps_io_basic.c:571: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). mumps_ooc_file_prefix=(char *)malloc((strlen(SEPARATOR)+strlen(tmp_dir)+strlen(tmp_fname)+strlen(base_name)+1+1)*sizeof(char)); data/mumps-5.3.5/src/mumps_io_basic.c:571: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). mumps_ooc_file_prefix=(char *)malloc((strlen(SEPARATOR)+strlen(tmp_dir)+strlen(tmp_fname)+strlen(base_name)+1+1)*sizeof(char)); data/mumps-5.3.5/src/mumps_io_basic.c:571:79: [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). mumps_ooc_file_prefix=(char *)malloc((strlen(SEPARATOR)+strlen(tmp_dir)+strlen(tmp_fname)+strlen(base_name)+1+1)*sizeof(char)); data/mumps-5.3.5/src/mumps_io_basic.c:571:97: [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). mumps_ooc_file_prefix=(char *)malloc((strlen(SEPARATOR)+strlen(tmp_dir)+strlen(tmp_fname)+strlen(base_name)+1+1)*sizeof(char)); data/mumps-5.3.5/src/mumps_io_basic.c:582: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). mumps_ooc_file_prefix=(char *)malloc((strlen(SEPARATOR)+strlen(tmp_dir)+strlen(base_name)+1)*sizeof(char)); data/mumps-5.3.5/src/mumps_io_basic.c:582: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). mumps_ooc_file_prefix=(char *)malloc((strlen(SEPARATOR)+strlen(tmp_dir)+strlen(base_name)+1)*sizeof(char)); data/mumps-5.3.5/src/mumps_io_basic.c:582:79: [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). mumps_ooc_file_prefix=(char *)malloc((strlen(SEPARATOR)+strlen(tmp_dir)+strlen(base_name)+1)*sizeof(char)); data/mumps-5.3.5/src/mumps_io_basic.c:604: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). *length=(MUMPS_INT)strlen(name)+1; data/mumps-5.3.5/src/mumps_io_basic.c:734:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret_code=read(*(MUMPS_INT *)file,loc_addr,size); data/mumps-5.3.5/src/mumps_io_err.c:88:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(mumps_err, desc, mumps_err_max_len); data/mumps-5.3.5/src/mumps_io_err.c:90: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). len = (MUMPS_INT) strlen(desc); data/mumps-5.3.5/src/mumps_io_err.c:115: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). len += (MUMPS_INT) strlen(desc); data/mumps-5.3.5/src/mumps_io_err.c:120: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). len += (MUMPS_INT) strlen(_err); data/mumps-5.3.5/src/mumps_io_err.c:135: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). _err_len = (MUMPS_INT) strlen(_err); data/mumps-5.3.5/src/mumps_save_restore_C.c:31: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). *len_save_dir = strlen(tmp_save_dir); data/mumps-5.3.5/src/mumps_save_restore_C.c:32:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). save_dir = strncpy(save_dir, tmp_save_dir, l1); data/mumps-5.3.5/src/mumps_save_restore_C.c:43: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). *len_save_prefix = strlen(tmp_save_prefix); data/mumps-5.3.5/src/mumps_save_restore_C.c:44:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). save_prefix = strncpy(save_prefix, tmp_save_prefix, l1); data/mumps-5.3.5/src/mumps_thread.c:16:25: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. #define USLEEP F_SYMBOL(usleep,USLEEP) data/mumps-5.3.5/src/mumps_thread.c:32:9: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep((unsigned int)*time); ANALYSIS SUMMARY: Hits = 126 Lines analyzed = 18561 in approximately 0.68 seconds (27277 lines/second) Physical Source Lines of Code (SLOC) = 12977 Hits@level = [0] 214 [1] 26 [2] 74 [3] 6 [4] 19 [5] 1 Hits@level+ = [0+] 340 [1+] 126 [2+] 100 [3+] 26 [4+] 20 [5+] 1 Hits/KSLOC@level+ = [0+] 26.2002 [1+] 9.70949 [2+] 7.70594 [3+] 2.00354 [4+] 1.54119 [5+] 0.0770594 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.