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/armci-mpi-0.3.1-beta/benchmarks/bench_groups.c Examining data/armci-mpi-0.3.1-beta/benchmarks/contiguous-bench.c Examining data/armci-mpi-0.3.1-beta/benchmarks/ping-pong.c Examining data/armci-mpi-0.3.1-beta/benchmarks/ring-flood.c Examining data/armci-mpi-0.3.1-beta/benchmarks/rmw_perf.c Examining data/armci-mpi-0.3.1-beta/benchmarks/strided-bench.c Examining data/armci-mpi-0.3.1-beta/src/armci-memdev.c Examining data/armci-mpi-0.3.1-beta/src/armci.h Examining data/armci-mpi-0.3.1-beta/src/armci_internals.h Examining data/armci-mpi-0.3.1-beta/src/armcix.h Examining data/armci-mpi-0.3.1-beta/src/buffer.c Examining data/armci-mpi-0.3.1-beta/src/conflict_tree.c Examining data/armci-mpi-0.3.1-beta/src/conflict_tree.h Examining data/armci-mpi-0.3.1-beta/src/debug.c Examining data/armci-mpi-0.3.1-beta/src/debug.h Examining data/armci-mpi-0.3.1-beta/src/gmr-extras.c Examining data/armci-mpi-0.3.1-beta/src/gmr.c Examining data/armci-mpi-0.3.1-beta/src/gmr.h Examining data/armci-mpi-0.3.1-beta/src/groups.c Examining data/armci-mpi-0.3.1-beta/src/init_finalize.c Examining data/armci-mpi-0.3.1-beta/src/internals.c Examining data/armci-mpi-0.3.1-beta/src/malloc.c Examining data/armci-mpi-0.3.1-beta/src/message.c Examining data/armci-mpi-0.3.1-beta/src/message.h Examining data/armci-mpi-0.3.1-beta/src/message_gop.c Examining data/armci-mpi-0.3.1-beta/src/mp3.h Examining data/armci-mpi-0.3.1-beta/src/mutex.c Examining data/armci-mpi-0.3.1-beta/src/mutex_hdl_queue.c Examining data/armci-mpi-0.3.1-beta/src/mutex_hdl_spin.c Examining data/armci-mpi-0.3.1-beta/src/onesided.c Examining data/armci-mpi-0.3.1-beta/src/onesided_nb.c Examining data/armci-mpi-0.3.1-beta/src/parmci.c Examining data/armci-mpi-0.3.1-beta/src/rmw.c Examining data/armci-mpi-0.3.1-beta/src/strided.c Examining data/armci-mpi-0.3.1-beta/src/strided_nb.c Examining data/armci-mpi-0.3.1-beta/src/topology.c Examining data/armci-mpi-0.3.1-beta/src/util.c Examining data/armci-mpi-0.3.1-beta/src/value_ops.c Examining data/armci-mpi-0.3.1-beta/src/vector.c Examining data/armci-mpi-0.3.1-beta/src/vector_nb.c Examining data/armci-mpi-0.3.1-beta/tests/ARMCI_AccS_latency.c Examining data/armci-mpi-0.3.1-beta/tests/ARMCI_PutS_latency.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/armci-perf.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/armci-test.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/cg/cg.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/cg/cg_timing.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/cg/compute.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/cg/generateinput.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/cg/mp3.h Examining data/armci-mpi-0.3.1-beta/tests/contrib/cg/read_input.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu-b-bc.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu-block.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu_timing.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/lu/mp3.h Examining data/armci-mpi-0.3.1-beta/tests/contrib/mp3.h Examining data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/mp3.h Examining data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/simple.c Examining data/armci-mpi-0.3.1-beta/tests/contrib/transp1D/mp3.h Examining data/armci-mpi-0.3.1-beta/tests/contrib/transp1D/transp1D-c.c Examining data/armci-mpi-0.3.1-beta/tests/ctree/ctree_test.c Examining data/armci-mpi-0.3.1-beta/tests/ctree/ctree_test_rand.c Examining data/armci-mpi-0.3.1-beta/tests/ctree/ctree_test_rand_interval.c Examining data/armci-mpi-0.3.1-beta/tests/mpi/copy_bench.c Examining data/armci-mpi-0.3.1-beta/tests/mpi/pgroup_bench.c Examining data/armci-mpi-0.3.1-beta/tests/mpi/ping-pong-mpi.c Examining data/armci-mpi-0.3.1-beta/tests/mpi/test_dt.c Examining data/armci-mpi-0.3.1-beta/tests/mpi/test_mpi_accs.c Examining data/armci-mpi-0.3.1-beta/tests/mpi/test_mpi_dim.c Examining data/armci-mpi-0.3.1-beta/tests/mpi/test_mpi_indexed_accs.c Examining data/armci-mpi-0.3.1-beta/tests/mpi/test_mpi_indexed_gets.c Examining data/armci-mpi-0.3.1-beta/tests/mpi/test_mpi_indexed_puts_gets.c Examining data/armci-mpi-0.3.1-beta/tests/mpi/test_mpi_subarray_accs.c Examining data/armci-mpi-0.3.1-beta/tests/mpi/test_win_create.c Examining data/armci-mpi-0.3.1-beta/tests/mpi/test_win_model.c Examining data/armci-mpi-0.3.1-beta/tests/test_accs.c Examining data/armci-mpi-0.3.1-beta/tests/test_accs_dla.c Examining data/armci-mpi-0.3.1-beta/tests/test_assert.c Examining data/armci-mpi-0.3.1-beta/tests/test_group_split.c Examining data/armci-mpi-0.3.1-beta/tests/test_groups.c Examining data/armci-mpi-0.3.1-beta/tests/test_igop.c Examining data/armci-mpi-0.3.1-beta/tests/test_malloc.c Examining data/armci-mpi-0.3.1-beta/tests/test_malloc_group.c Examining data/armci-mpi-0.3.1-beta/tests/test_malloc_irreg.c Examining data/armci-mpi-0.3.1-beta/tests/test_mutex.c Examining data/armci-mpi-0.3.1-beta/tests/test_mutex_rmw.c Examining data/armci-mpi-0.3.1-beta/tests/test_mutex_trylock.c Examining data/armci-mpi-0.3.1-beta/tests/test_onesided.c Examining data/armci-mpi-0.3.1-beta/tests/test_onesided_shared.c Examining data/armci-mpi-0.3.1-beta/tests/test_onesided_shared_dla.c Examining data/armci-mpi-0.3.1-beta/tests/test_parmci.c Examining data/armci-mpi-0.3.1-beta/tests/test_parmci_lib.c Examining data/armci-mpi-0.3.1-beta/tests/test_puts.c Examining data/armci-mpi-0.3.1-beta/tests/test_puts_gets.c Examining data/armci-mpi-0.3.1-beta/tests/test_puts_gets_dla.c Examining data/armci-mpi-0.3.1-beta/tests/test_putv.c Examining data/armci-mpi-0.3.1-beta/tests/test_rmw_fadd.c FINAL RESULTS: data/armci-mpi-0.3.1-beta/src/debug.c:79:11: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. disp += vsnprintf(string+disp, 500-disp, format, etc); data/armci-mpi-0.3.1-beta/src/debug.c:96:11: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. disp += vsnprintf(string+disp, 500-disp, fmt, etc); data/armci-mpi-0.3.1-beta/src/internals.c:38:11: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. disp += vsnprintf(string, 500, msg, ap); data/armci-mpi-0.3.1-beta/src/malloc.c:81:18: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. count += snprintf(ptr_string+count, BUF_LEN-count, data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:99:9: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. r = vprintf(fmt, ap); data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:116: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(exe_name, fname); data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:130:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(log_path, "%s/data/%s.dat", exe_name, exe_name + k); data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:133:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(log_path, "%s.dat", exe_name); data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:162:13: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. r = vfprintf(log_file, fmt, ap); data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:165:13: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. r = vfprintf(stderr, fmt, ap); data/armci-mpi-0.3.1-beta/benchmarks/contiguous-bench.c:52:7: [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. if (getenv("ARMCIX_MODE_SET")) data/armci-mpi-0.3.1-beta/benchmarks/rmw_perf.c:44:20: [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. char * cfair = getenv ("CHECK_FAIRNESS"); data/armci-mpi-0.3.1-beta/benchmarks/strided-bench.c:58:7: [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. if (getenv("ARMCIX_MODE_SET")) data/armci-mpi-0.3.1-beta/src/util.c:146: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. const char *var = getenv(varname); data/armci-mpi-0.3.1-beta/src/util.c:162:10: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. return getenv(varname); data/armci-mpi-0.3.1-beta/src/util.c:169: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. const char *var = getenv(varname); data/armci-mpi-0.3.1-beta/src/util.c:180: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. const char *var = getenv(varname); data/armci-mpi-0.3.1-beta/tests/contrib/armci-test.c:773:11: [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. (void)srand((unsigned)me); data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu-b-bc.c:78:18: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((ch = getopt(argc, argv, "n:b:p:h")) != -1) { data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu-block.c:78:18: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((ch = getopt(argc, argv, "n:b:p:h")) != -1) { data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu.c:84:18: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((ch = getopt(argc, argv, "n:b:p:h")) != -1) { data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:662:5: [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(time_seed); rand(); data/armci-mpi-0.3.1-beta/tests/ctree/ctree_test_rand.c:18:3: [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(time(NULL)); data/armci-mpi-0.3.1-beta/tests/ctree/ctree_test_rand_interval.c:22:3: [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(time(NULL)); data/armci-mpi-0.3.1-beta/benchmarks/rmw_perf.c:42:30: [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). int count = ( argc > 1 ? atoi(argv[1]) : 1000000 ); data/armci-mpi-0.3.1-beta/src/conflict_tree.c:299: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 s[32] = ""; data/armci-mpi-0.3.1-beta/src/debug.c:74: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 string[500]; data/armci-mpi-0.3.1-beta/src/debug.c:91: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 string[500]; data/armci-mpi-0.3.1-beta/src/init_finalize.c:329: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. char suffix[4] = {0}; data/armci-mpi-0.3.1-beta/src/init_finalize.c:332: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. char * bsuffix[5] = {"", "KiB","MiB","GiB","TiB"}; data/armci-mpi-0.3.1-beta/src/init_finalize.c:341: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. char * dsuffix[5] = {"","KB","MB","GB","TB"}; data/armci-mpi-0.3.1-beta/src/internals.c:34: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 string[500]; data/armci-mpi-0.3.1-beta/src/malloc.c:74: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 ptr_string[BUF_LEN]; data/armci-mpi-0.3.1-beta/src/util.c:171:12: [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). return atoi(var); data/armci-mpi-0.3.1-beta/src/util.c:182:12: [2] (integer) atol: 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). return atol(var); data/armci-mpi-0.3.1-beta/tests/ARMCI_AccS_latency.c:110:17: [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 temp[10]; data/armci-mpi-0.3.1-beta/tests/ARMCI_AccS_latency.c:111:17: [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(temp, "%dX%d", (int) xdim, (int) ydim); data/armci-mpi-0.3.1-beta/tests/ARMCI_PutS_latency.c:79: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. char temp[10]; data/armci-mpi-0.3.1-beta/tests/ARMCI_PutS_latency.c:80:11: [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(temp,"%dX%d", xdim, ydim); data/armci-mpi-0.3.1-beta/tests/contrib/armci-perf.c:37: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 check_type[15]; data/armci-mpi-0.3.1-beta/tests/contrib/armci-perf.c:104:13: [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(check_type, "ARMCI_GetS:"); data/armci-mpi-0.3.1-beta/tests/contrib/armci-perf.c:174:13: [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(check_type, "ARMCI_PutS:"); data/armci-mpi-0.3.1-beta/tests/contrib/armci-perf.c:241:13: [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(check_type, "ARMCI_AccS:"); data/armci-mpi-0.3.1-beta/tests/contrib/armci-test.c:56:31: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define COPY(src, dst, bytes) memcpy((dst),(src),(bytes)) data/armci-mpi-0.3.1-beta/tests/contrib/armci-test.c:242:4: [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 msg[48]; data/armci-mpi-0.3.1-beta/tests/contrib/armci-test.c:243:4: [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(msg,"(proc=%d):%f",me,patch1[idx1]); data/armci-mpi-0.3.1-beta/tests/contrib/armci-test.c:245:4: [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(msg,"%f\n",patch2[idx2]); data/armci-mpi-0.3.1-beta/tests/contrib/cg/cg.c:65:18: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if(me==0)memcpy(dvec,rvec,na*sizeof(double)); data/armci-mpi-0.3.1-beta/tests/contrib/cg/cg.c:223:14: [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). fd = fopen("cg_output.out", "w"); data/armci-mpi-0.3.1-beta/tests/contrib/cg/generateinput.c:12:10: [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). fd = open("matrix.bin",O_CREAT|O_WRONLY,0777); data/armci-mpi-0.3.1-beta/tests/contrib/cg/read_input.c:23:10: [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). fd = fopen("randominput.dat", "w"); data/armci-mpi-0.3.1-beta/tests/contrib/cg/read_input.c:32: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). na = atoi(argv[1]); data/armci-mpi-0.3.1-beta/tests/contrib/cg/read_input.c:33: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). nz = atoi(argv[2]); data/armci-mpi-0.3.1-beta/tests/contrib/cg/read_input.c:37:15: [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). fd = fopen(argv[3], "r"); data/armci-mpi-0.3.1-beta/tests/contrib/cg/read_input.c:51:15: [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). fd = fopen("randominput.dat", "r"); data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu-b-bc.c:80:27: [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). case 'n': n = atoi(optarg); break; data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu-b-bc.c:81: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). case 'b': block_size = atoi(optarg); break; data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu-b-bc.c:82:31: [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). case 'p': nproc = atoi(optarg); break; data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu-block.c:80:27: [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). case 'n': n = atoi(optarg); break; data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu-block.c:81: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). case 'b': block_size = atoi(optarg); break; data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu-block.c:82:31: [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). case 'p': nproc = atoi(optarg); break; data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu.c:86:27: [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). case 'n': n = atoi(optarg); break; data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu.c:87: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). case 'b': block_size = atoi(optarg); break; data/armci-mpi-0.3.1-beta/tests/contrib/lu/lu.c:88:31: [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). case 'p': nproc = atoi(optarg); break; data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:111: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 exe_name[255]; data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:112: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 log_path[255]; data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:137:16: [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). log_file = fopen(log_path, "w"); data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:227:19: [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 *)array_ptrs[rank])[i] = (char)(rand() >> 24); data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:245:31: [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 *)((char *)array_ptrs[rank] + l) = rand(); data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:614: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 buf[255]; data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:682:14: [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. j += sprintf(buf + j, " %d->%d", p_srcs[i], p_dsts[i]); data/armci-mpi-0.3.1-beta/tests/mpi/copy_bench.c:31:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, in, i); data/armci-mpi-0.3.1-beta/tests/mpi/test_mpi_dim.c:55:31: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define COPY(src, dst, bytes) memcpy((dst),(src),(bytes)) data/armci-mpi-0.3.1-beta/tests/mpi/test_mpi_dim.c:248:4: [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 msg[48]; data/armci-mpi-0.3.1-beta/tests/mpi/test_mpi_dim.c:249:4: [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(msg,"(proc=%d):%f",me,patch1[idx1]); data/armci-mpi-0.3.1-beta/tests/mpi/test_mpi_dim.c:251:4: [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(msg,"%f\n",patch2[idx2]); data/armci-mpi-0.3.1-beta/src/conflict_tree.c:304:14: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. idx += sprintf(s+idx, "\t"); data/armci-mpi-0.3.1-beta/src/init_finalize.c:56:22: [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. if (naptime) usleep(naptime); data/armci-mpi-0.3.1-beta/src/init_finalize.c:339:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(suffix, bsuffix[offset], sizeof(suffix)); data/armci-mpi-0.3.1-beta/src/init_finalize.c:348:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(suffix, dsuffix[offset], sizeof(suffix)); data/armci-mpi-0.3.1-beta/src/malloc.c:78:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(ptr_string, "NULL", 5); data/armci-mpi-0.3.1-beta/src/mutex_hdl_spin.c:144:5: [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(timeout + rand()%timeout); data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:117: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). if (exe_name[strlen(exe_name) - 2] == '.') /* remove .x */ data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:118: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). exe_name[strlen(exe_name) - 2] = 0; data/armci-mpi-0.3.1-beta/tests/contrib/non-blocking/overlap.c:121: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). for (i = strlen(exe_name) - 1, k = -1; i >= 0; i--) ANALYSIS SUMMARY: Hits = 85 Lines analyzed = 19237 in approximately 0.50 seconds (38337 lines/second) Physical Source Lines of Code (SLOC) = 13058 Hits@level = [0] 474 [1] 9 [2] 52 [3] 14 [4] 10 [5] 0 Hits@level+ = [0+] 559 [1+] 85 [2+] 76 [3+] 24 [4+] 10 [5+] 0 Hits/KSLOC@level+ = [0+] 42.809 [1+] 6.50942 [2+] 5.82019 [3+] 1.83795 [4+] 0.765814 [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.