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/abinit-8.10.3/bindings/parser/ab7.h Examining data/abinit-8.10.3/bindings/parser/ab7_base.c Examining data/abinit-8.10.3/bindings/parser/ab7_base.h Examining data/abinit-8.10.3/bindings/parser/ab7_invars.h Examining data/abinit-8.10.3/bindings/parser/ab7_invars_c.c Examining data/abinit-8.10.3/bindings/parser/ab7_invars_c.h Examining data/abinit-8.10.3/bindings/parser/ab7_invars_py.c Examining data/abinit-8.10.3/bindings/parser/ab7_invars_py.h Examining data/abinit-8.10.3/bindings/parser/ab7_kpoints.c Examining data/abinit-8.10.3/bindings/parser/ab7_kpoints.h Examining data/abinit-8.10.3/bindings/parser/ab7_symmetry.c Examining data/abinit-8.10.3/bindings/parser/ab7_symmetry.h Examining data/abinit-8.10.3/bindings/parser/check_invars_c.c Examining data/abinit-8.10.3/bindings/parser/check_symmetry_c.c Examining data/abinit-8.10.3/config/detect/detect_cc.c Examining data/abinit-8.10.3/doc/developers/strain_nonlocal/format_code.c Examining data/abinit-8.10.3/scripts/post_processing/matlab_data_analysis/mexData.c Examining data/abinit-8.10.3/src/incs/abi_clib.h Examining data/abinit-8.10.3/src/incs/abi_common.h Examining data/abinit-8.10.3/src/incs/abi_gpu_header.h Examining data/abinit-8.10.3/src/incs/abi_xc_vdw.h Examining data/abinit-8.10.3/src/incs/cuda_common.h Examining data/abinit-8.10.3/src/incs/cuda_header.h Examining data/abinit-8.10.3/src/incs/cuda_rec_head.h Examining data/abinit-8.10.3/src/incs/string_f.h Examining data/abinit-8.10.3/src/01_gsl_ext/gsl_f90_sf_bessel_j0.c Examining data/abinit-8.10.3/src/01_gsl_ext/gsl_f90_sf_bessel_jl.c Examining data/abinit-8.10.3/src/01_gsl_ext/gsl_f90_sf_gamma.c Examining data/abinit-8.10.3/src/02_clib/align.c Examining data/abinit-8.10.3/src/02_clib/calling_levmar.c Examining data/abinit-8.10.3/src/02_clib/cclock.c Examining data/abinit-8.10.3/src/02_clib/etime.c Examining data/abinit-8.10.3/src/02_clib/fsi_posix.c Examining data/abinit-8.10.3/src/02_clib/gnu_tools.c Examining data/abinit-8.10.3/src/02_clib/intrinsics.c Examining data/abinit-8.10.3/src/02_clib/mallinfo.c Examining data/abinit-8.10.3/src/02_clib/md5.c Examining data/abinit-8.10.3/src/02_clib/progress_bar.c Examining data/abinit-8.10.3/src/02_clib/xexit.c Examining data/abinit-8.10.3/src/02_clib/xmalloc.c Examining data/abinit-8.10.3/src/02_clib/md5.h Examining data/abinit-8.10.3/src/02_clib/xmalloc.h Examining data/abinit-8.10.3/src/17_libtetra_ext/libtetra.h Examining data/abinit-8.10.3/src/41_geometry/ab7_symmetry.fortran.h Examining data/abinit-8.10.3/src/41_xc_lowlevel/libxc_tools.c Examining data/abinit-8.10.3/src/42_libpaw/libpaw.h Examining data/abinit-8.10.3/src/42_libpaw/libpaw_libxc.c Examining data/abinit-8.10.3/src/56_recipspace/ab7_kpoints.fortran.h Examining data/abinit-8.10.3/src/62_ctqmc/defs.h Examining data/abinit-8.10.3/src/62_ctqmc/BathOperator_hybrid.h Examining data/abinit-8.10.3/src/62_ctqmc/BathOperatoroffdiag_hybrid.h Examining data/abinit-8.10.3/src/62_ctqmc/ListCdagC_firstHigher.h Examining data/abinit-8.10.3/src/67_triqs_ext/triqs_cthyb_qmc.cpp Examining data/abinit-8.10.3/src/67_triqs_ext/triqs_cthyb_qmc.hpp Examining data/abinit-8.10.3/src/78_effpot/effpot_xml.c Examining data/abinit-8.10.3/tests/Timeout/timeout.c FINAL RESULTS: data/abinit-8.10.3/bindings/parser/ab7_invars_py.c:22:36: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define DBG_printf if (DEBUG_MODE) printf data/abinit-8.10.3/bindings/parser/ab7_invars_py.c:24:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define DBG_printf if (0) printf data/abinit-8.10.3/config/detect/detect_cc.c:15:9: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #define system "linux" data/abinit-8.10.3/config/detect/detect_cc.c:17:9: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #define system "macosx" data/abinit-8.10.3/config/detect/detect_cc.c:19:9: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #define system "unknown" data/abinit-8.10.3/config/detect/detect_cc.c:21:58: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. printf("gnu %d.%d %s %s\n",__GNUC__,__GNUC_MINOR__,arch,system); data/abinit-8.10.3/src/02_clib/progress_bar.c:101:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, fmt, my_actual, *max); data/abinit-8.10.3/src/02_clib/progress_bar.c:107:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf + strlen(buf), data/abinit-8.10.3/src/02_clib/progress_bar.c:136:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf + strlen(buf),"%02d:%02d%s", i / 60, i % 60," ETA"); data/abinit-8.10.3/src/02_clib/progress_bar.c:155:10: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). return strcat(dest, src); data/abinit-8.10.3/tests/Timeout/timeout.c:123:2: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(argv[1], argv + 1); data/abinit-8.10.3/src/02_clib/intrinsics.c:45:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. cvalue = getenv (cname); data/abinit-8.10.3/src/02_clib/intrinsics.c:85:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. cvalue = getenv(cname); data/abinit-8.10.3/src/02_clib/progress_bar.c:56:11: [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. env = getenv("COLUMNS"); data/abinit-8.10.3/bindings/parser/ab7_invars_c.c:51: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[8] = " "; data/abinit-8.10.3/bindings/parser/ab7_invars_py.c:411:40: [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. void FC_FUNC(wrtout, WRTOUT)(int *unit,char message[500]) data/abinit-8.10.3/bindings/parser/ab7_invars_py.c:472: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. return memcpy (new, s, len); data/abinit-8.10.3/bindings/parser/ab7_symmetry.c:226: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 **spaceGroup, int *spaceGroupId, data/abinit-8.10.3/bindings/parser/ab7_symmetry.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 name[15]; data/abinit-8.10.3/bindings/parser/ab7_symmetry.c:276: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 label_[128]; data/abinit-8.10.3/bindings/parser/ab7_symmetry.h:223:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char **spaceGroup, int *spaceGroupId, data/abinit-8.10.3/scripts/post_processing/matlab_data_analysis/mexData.c:19:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char strSign[128] = "Eigenvalues ( eV ) for nkpt=", data/abinit-8.10.3/scripts/post_processing/matlab_data_analysis/mexData.c:76:13: [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). if (!(fp = fopen(filename, "rb"))) data/abinit-8.10.3/scripts/post_processing/matlab_data_analysis/mexData.c:105:2: [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[128]; data/abinit-8.10.3/src/02_clib/md5.c:232:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[BUFSIZE]; data/abinit-8.10.3/src/02_clib/md5.c:240:7: [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). fc = fopen(path, "r"); data/abinit-8.10.3/src/02_clib/md5.c:255:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[17]; data/abinit-8.10.3/src/02_clib/md5.c:306:3: [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(result+i*2, "%2.2x", buffer[i]); data/abinit-8.10.3/src/02_clib/md5.c:338:4: [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(&ctx->buffer[used], data, size); data/abinit-8.10.3/src/02_clib/md5.c:342: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(&ctx->buffer[used], data, available); data/abinit-8.10.3/src/02_clib/md5.c:353:2: [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(ctx->buffer, data, size); data/abinit-8.10.3/src/02_clib/md5.h:37:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[64]; data/abinit-8.10.3/src/02_clib/progress_bar.c:57:21: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (env) cols = atoi(env); data/abinit-8.10.3/src/02_clib/progress_bar.c:72:2: [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[BUFFER_SIZE], fmt[FMT_SIZE]; data/abinit-8.10.3/src/02_clib/progress_bar.c:96:2: [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, "%d", *max); data/abinit-8.10.3/src/02_clib/progress_bar.c:99:2: [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(fmt, "\r[%%%dd/%%%dd]", i, i); data/abinit-8.10.3/src/02_clib/progress_bar.c:102:3: [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 + strlen(buf), " %3d%%" , ratio); data/abinit-8.10.3/src/02_clib/progress_bar.c:124: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 + strlen(buf)," --:-- ETA"); data/abinit-8.10.3/src/02_clib/progress_bar.c:131: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 + strlen(buf),"%4d:", i); data/abinit-8.10.3/src/02_clib/progress_bar.c:133: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 + strlen(buf)," "); data/abinit-8.10.3/src/67_triqs_ext/triqs_cthyb_qmc.cpp:285:14: [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). gtau.open("Gtau_triqs.dat"); data/abinit-8.10.3/src/67_triqs_ext/triqs_cthyb_qmc.cpp:306:14: [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). g_iw.open("giw"); data/abinit-8.10.3/src/67_triqs_ext/triqs_cthyb_qmc.cpp:320:14: [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). umat.open("umat"); data/abinit-8.10.3/src/67_triqs_ext/triqs_cthyb_qmc.cpp:330:13: [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). g_l.open("gl"); data/abinit-8.10.3/src/78_effpot/effpot_xml.c:234:28: [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. void effpot_xml_readSystem(char *filename,int *natom,int *ntypat,int *nrpt,int *nqpt, data/abinit-8.10.3/src/78_effpot/effpot_xml.c:412:36: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). cell_local[irpt1][i]=atoi(pch); data/abinit-8.10.3/src/78_effpot/effpot_xml.c:449:36: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). cell_total[irpt2][i]=atoi(pch); data/abinit-8.10.3/src/78_effpot/effpot_xml.c:654:36: [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. void effpot_xml_readStrainCoupling(char *filename,int *natom,int *nrpt,int *voigt, data/abinit-8.10.3/src/78_effpot/effpot_xml.c:687:10: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if(atoi(uri) == *voigt){ data/abinit-8.10.3/src/78_effpot/effpot_xml.c:690:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (atoi(uri)<=12) { data/abinit-8.10.3/src/78_effpot/effpot_xml.c:753:50: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). phonon_straincell[irpt][i]=atoi(pch); data/abinit-8.10.3/src/78_effpot/effpot_xml.c:778:27: [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. void effpot_xml_readCoeff(char *filename,int*ncoeff,int*ndisp,int*nterm, data/abinit-8.10.3/src/78_effpot/effpot_xml.c:1605:20: [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. void xml_read_spin(char *fname, double *ref_energy, double *unitcell[9], data/abinit-8.10.3/src/78_effpot/effpot_xml.c:1728:20: [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. void xml_read_spin(char *fname, double *ref_energy, double *unitcell[9], data/abinit-8.10.3/src/incs/cuda_header.h:62: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(message,"CUFFT_SUCCESS"); data/abinit-8.10.3/src/incs/cuda_header.h:65: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(message,"CUFFT_INVALID_PLAN"); data/abinit-8.10.3/src/incs/cuda_header.h:68: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(message,"CUFFT_ALLOC_FAILED"); data/abinit-8.10.3/src/incs/cuda_header.h:71: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(message,"CUFFT_INVALID_TYPE"); data/abinit-8.10.3/src/incs/cuda_header.h:74: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(message,"CUFFT_INVALID_VALUE"); data/abinit-8.10.3/src/incs/cuda_header.h:77: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(message,"CUFFT_INTERNAL_ERROR"); data/abinit-8.10.3/src/incs/cuda_header.h:80: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(message,"CUFFT_EXEC_FAILED"); data/abinit-8.10.3/src/incs/cuda_header.h:83: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(message,"CUFFT_SETUP_FAILED"); data/abinit-8.10.3/src/incs/cuda_header.h:86: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(message,"CUFFT_INVALID_SIZE"); data/abinit-8.10.3/src/incs/cuda_header.h:89: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(message,"CUFFT_UNALIGNED_DATA"); data/abinit-8.10.3/src/incs/cuda_header.h:92: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(message,"CUFFT_UNKNOWN_ERROR"); data/abinit-8.10.3/tests/Timeout/timeout.c:106:21: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((kill_signal = atoi(*argv + 1)) <= 0) data/abinit-8.10.3/tests/Timeout/timeout.c:109:36: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (argc < 2 || (time_to_run = atoi(argv[0])) <= 0) data/abinit-8.10.3/bindings/parser/ab7_invars_c.c:53:7: [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). n = strlen(filename); data/abinit-8.10.3/bindings/parser/ab7_invars_c.c:73:7: [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). n = strlen(filename); data/abinit-8.10.3/bindings/parser/ab7_invars_c.c:83:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(psp + 264 * npsp, pspfiles[npsp], 264); data/abinit-8.10.3/bindings/parser/ab7_invars_c.c:104:7: [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). n = strlen(string); data/abinit-8.10.3/doc/developers/strain_nonlocal/format_code.c:24:14: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((c = getchar()) != EOF){ data/abinit-8.10.3/doc/developers/strain_nonlocal/format_code.c:32:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if((c = getchar()) == '\n'){ data/abinit-8.10.3/doc/developers/strain_nonlocal/format_code.c:33:17: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if((c = getchar()) == '#'){ data/abinit-8.10.3/scripts/post_processing/matlab_data_analysis/mexData.c:34:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ScanChar = fgetc(fp); data/abinit-8.10.3/scripts/post_processing/matlab_data_analysis/mexData.c:39:24: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((ScanChar = fgetc(fp)) != Str[i]) data/abinit-8.10.3/scripts/post_processing/matlab_data_analysis/mexData.c:50:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ScanChar = fgetc(fp); data/abinit-8.10.3/scripts/post_processing/matlab_data_analysis/mexData.c:55:24: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((ScanChar = fgetc(fp)) != Str[i]) data/abinit-8.10.3/scripts/post_processing/matlab_data_analysis/mexData.c:71: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). int ScanLength = strlen(strSign); data/abinit-8.10.3/scripts/post_processing/matlab_data_analysis/mexData.c:72: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). int ScanLength2 = strlen(strSign2); data/abinit-8.10.3/scripts/post_processing/matlab_data_analysis/mexData.c:73: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). int InnerIntervalLength = strlen(strInnerInterval); data/abinit-8.10.3/scripts/post_processing/matlab_data_analysis/mexData.c:74: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). int OuterIntervalLength = strlen(strOuterInterval); data/abinit-8.10.3/src/02_clib/fsi_posix.c:112:8: [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). ln = strlen(cname); data/abinit-8.10.3/src/02_clib/fsi_posix.c:152:8: [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). ln = strlen(cname); data/abinit-8.10.3/src/02_clib/intrinsics.c:49:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (cvalue && strlen(cvalue) <= l2 ){ data/abinit-8.10.3/src/02_clib/intrinsics.c:86:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). q_len = (cvalue == NULL) ? 0 : strlen(cvalue); data/abinit-8.10.3/src/02_clib/md5.c:229:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(int, void *, unsigned int); data/abinit-8.10.3/src/02_clib/md5.c:245:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes = read(fd, (void *)buffer, BUFSIZE); data/abinit-8.10.3/src/02_clib/progress_bar.c:97:6: [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). i = strlen(buf); data/abinit-8.10.3/src/02_clib/progress_bar.c:102:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sprintf(buf + strlen(buf), " %3d%%" , ratio); data/abinit-8.10.3/src/02_clib/progress_bar.c:104:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). barlength = get_tty_width() - strlen(buf) - 15; data/abinit-8.10.3/src/02_clib/progress_bar.c:107: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). sprintf(buf + strlen(buf), data/abinit-8.10.3/src/02_clib/progress_bar.c:124: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). sprintf(buf + strlen(buf)," --:-- ETA"); data/abinit-8.10.3/src/02_clib/progress_bar.c:131:21: [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). sprintf(buf + strlen(buf),"%4d:", i); data/abinit-8.10.3/src/02_clib/progress_bar.c:133:21: [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). sprintf(buf + strlen(buf)," "); data/abinit-8.10.3/src/02_clib/progress_bar.c:136: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). sprintf(buf + strlen(buf),"%02d:%02d%s", i / 60, i % 60," ETA"); data/abinit-8.10.3/src/02_clib/progress_bar.c:148:36: [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 space_left = *size_dest - strlen(dest) -1; data/abinit-8.10.3/src/02_clib/progress_bar.c:150:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ( strlen(src) > space_left ) { /* Have to realloc DEST */ data/abinit-8.10.3/src/02_clib/progress_bar.c:151:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *size_dest = strlen(dest) + strlen(src) + 1; data/abinit-8.10.3/src/02_clib/progress_bar.c:151:33: [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_dest = strlen(dest) + strlen(src) + 1; data/abinit-8.10.3/src/incs/string_f.h:34:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(c, _fcdtocp(f), slen); \ data/abinit-8.10.3/src/incs/string_f.h:42:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(c, _fcdtocp(f), slen); \ data/abinit-8.10.3/src/incs/string_f.h:50:10: [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). clen = strlen(c); \ ANALYSIS SUMMARY: Hits = 103 Lines analyzed = 9866 in approximately 0.36 seconds (27072 lines/second) Physical Source Lines of Code (SLOC) = 7405 Hits@level = [0] 137 [1] 36 [2] 53 [3] 3 [4] 11 [5] 0 Hits@level+ = [0+] 240 [1+] 103 [2+] 67 [3+] 14 [4+] 11 [5+] 0 Hits/KSLOC@level+ = [0+] 32.4105 [1+] 13.9095 [2+] 9.04794 [3+] 1.89061 [4+] 1.48548 [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.