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/rabit-0.0~git20200628.74bf00a/guide/basic.cc Examining data/rabit-0.0~git20200628.74bf00a/guide/broadcast.cc Examining data/rabit-0.0~git20200628.74bf00a/guide/lazy_allreduce.cc Examining data/rabit-0.0~git20200628.74bf00a/include/rabit/base.h Examining data/rabit-0.0~git20200628.74bf00a/include/rabit/c_api.h Examining data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/engine.h Examining data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/io.h Examining data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/rabit-inl.h Examining data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/socket.h Examining data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/thread_local.h Examining data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/timer.h Examining data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/utils.h Examining data/rabit-0.0~git20200628.74bf00a/include/rabit/rabit.h Examining data/rabit-0.0~git20200628.74bf00a/include/rabit/serializable.h Examining data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc Examining data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.h Examining data/rabit-0.0~git20200628.74bf00a/src/allreduce_mock.h Examining data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust-inl.h Examining data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc Examining data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.h Examining data/rabit-0.0~git20200628.74bf00a/src/c_api.cc Examining data/rabit-0.0~git20200628.74bf00a/src/engine.cc Examining data/rabit-0.0~git20200628.74bf00a/src/engine_base.cc Examining data/rabit-0.0~git20200628.74bf00a/src/engine_empty.cc Examining data/rabit-0.0~git20200628.74bf00a/src/engine_mock.cc Examining data/rabit-0.0~git20200628.74bf00a/src/engine_mpi.cc Examining data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cc Examining data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cpp Examining data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_mock_test.cc Examining data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_mock_test.cpp Examining data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc Examining data/rabit-0.0~git20200628.74bf00a/test/cpp/test_io.cc Examining data/rabit-0.0~git20200628.74bf00a/test/cpp/test_main.cpp Examining data/rabit-0.0~git20200628.74bf00a/test/lazy_recover.cc Examining data/rabit-0.0~git20200628.74bf00a/test/local_recover.cc Examining data/rabit-0.0~git20200628.74bf00a/test/model_recover.cc Examining data/rabit-0.0~git20200628.74bf00a/test/speed_test.cc FINAL RESULTS: data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/rabit-inl.h:226:3: [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. vsnprintf(&msg[0], kPrintBuffer, fmt, args); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/utils.h:30:9: [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. #define snprintf sprintf_s data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/utils.h:31:9: [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. #define vsnprintf vsprintf_s data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/utils.h:121:3: [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. vsnprintf(&msg[0], kPrintBuffer, fmt, args); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/utils.h:147:3: [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. vsnprintf(&msg[0], kPrintBuffer, fmt, args); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/utils.h:155:13: [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. int ret = vsnprintf(buf, size, fmt, args); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/utils.h:166:5: [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. vsnprintf(&msg[0], kPrintBuffer, fmt, args); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/utils.h:178:5: [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. vsnprintf(&msg[0], kPrintBuffer, fmt, args); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/utils.h:190:5: [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. vsnprintf(&msg[0], kPrintBuffer, fmt, args); data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:65:9: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if (sscanf(argv[i], "%[^=]=%s", name, val) == 2) { data/rabit-0.0~git20200628.74bf00a/src/c_api.cc:257: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(out_name, s.c_str()); // NOLINT(*) data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:57:25: [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 *value = getenv(env_vars[i].c_str()); data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:72:27: [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 *task_id = getenv("mapred_tip_id"); data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:74:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. task_id = getenv("mapreduce_task_id"); data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:84:30: [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 *attempt_id = getenv("mapred_task_id"); data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:93:28: [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 *num_task = getenv("mapred_map_tasks"); data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:95: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. num_task = getenv("mapreduce_job_maps"); data/rabit-0.0~git20200628.74bf00a/test/lazy_recover.cc:97: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(0); data/rabit-0.0~git20200628.74bf00a/test/local_recover.cc:108: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(0); data/rabit-0.0~git20200628.74bf00a/test/model_recover.cc:126: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(0); data/rabit-0.0~git20200628.74bf00a/test/speed_test.cc:76: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(0); data/rabit-0.0~git20200628.74bf00a/guide/basic.cc:16:9: [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). N = atoi(argv[1]); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/io.h:38:26: [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 (nread != 0) std::memcpy(ptr, p_buffer_ + curr_ptr_, nread); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/io.h:46: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. std::memcpy(p_buffer_ + curr_ptr_, ptr, size); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/io.h:84:26: [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 (nread != 0) std::memcpy(ptr, &(*p_buffer_)[0] + curr_ptr_, nread); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/io.h:93: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. std::memcpy(&(*p_buffer_)[0] + curr_ptr_, ptr, size); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/rabit-inl.h:267: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. std::memcpy(pdst + i * kUnit, &tdst, sizeof(tdst)); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/socket.h:76:5: [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(&addr, res->ai_addr, res->ai_addrlen); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/utils.h:24:22: [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). #define fopen64 std::fopen data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/utils.h:43:22: [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). #define fopen64 std::fopen data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/utils.h:83:59: [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 CompareStringsCaseInsensitive(s, "true") == 0 || atoi(s) != 0; data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:64: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 name[256], val[256]; data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:182:59: [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 (!strcmp(name, "rabit_tracker_port")) tracker_port = atoi(val); data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:185:58: [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 (!strcmp(name, "DMLC_TRACKER_PORT")) tracker_port = atoi(val); data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:188:55: [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 (!strcmp(name, "rabit_world_size")) world_size = atoi(val); data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:191:28: [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). reduce_ring_mincount = atoi(val); data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:198: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). connect_retry = atoi(val); data/rabit-0.0~git20200628.74bf00a/src/allreduce_base.cc:219:19: [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). timeout_sec = atoi(val); data/rabit-0.0~git20200628.74bf00a/src/allreduce_mock.h:35:55: [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 (!strcmp(name, "rabit_num_trial")) num_trial = atoi(val); data/rabit-0.0~git20200628.74bf00a/src/allreduce_mock.h:36:56: [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 (!strcmp(name, "DMLC_NUM_ATTEMPT")) num_trial = atoi(val); data/rabit-0.0~git20200628.74bf00a/src/allreduce_mock.h:37:55: [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 (!strcmp(name, "report_stats")) report_stats = atoi(val); data/rabit-0.0~git20200628.74bf00a/src/allreduce_mock.h:38:53: [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 (!strcmp(name, "force_local")) force_local = atoi(val); data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:94:67: [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 (!strcmp(name, "rabit_global_replica")) num_global_replica = atoi(val); data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:96:25: [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). num_local_replica = atoi(val); data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:118:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(temp, buf, type_nbytes*count); data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:123:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(name, key.c_str(), strlen(k.c_str()) + 1); data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:152:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(buf, temp, type_nbytes*count); data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:201:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(temp, sendrecvbuf, total_size); break; data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:203:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(temp, sendrecvbuf, total_size); data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:206:14: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(sendrecvbuf, temp, total_size); break; data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:279:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(temp, sendrecvbuf_, type_nbytes * count); break; data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:281:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(temp, sendrecvbuf_, type_nbytes * count); data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:283:14: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(sendrecvbuf_, temp, type_nbytes * count); break; data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:336:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(temp, sendrecvbuf_, total_size); break; data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:339:14: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(temp, sendrecvbuf_, total_size); break; data/rabit-0.0~git20200628.74bf00a/src/engine_mpi.cc:91: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 name[MPI_MAX_PROCESSOR_NAME]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cc:13:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[rabit_task_id.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cc:27:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[rabit_task_id.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cc:32: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 cmd2[rabit_bootstrap_cache.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cc: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 cmd3[rabit_debug.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cc:53:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[rabit_task_id.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cc:58: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 cmd2[rabit_reduce_ring_mincount.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cpp:13:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[rabit_task_id.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cpp:27:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[rabit_task_id.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cpp:32: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 cmd2[rabit_bootstrap_cache.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cpp: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 cmd3[rabit_debug.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cpp:53:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[rabit_task_id.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_base_test.cpp:58: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 cmd2[rabit_reduce_ring_mincount.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_mock_test.cc:13:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[mock_str.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_mock_test.cc:27:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[mock_str.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_mock_test.cpp:13:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[mock_str.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_mock_test.cpp:27:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[mock_str.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_mock_test.cpp:42:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[mock_str.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:19:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[rabit_timeout.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:24: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 cmd1[rabit_timeout_sec.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:44:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[rabit_timeout.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:49: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 cmd1[rabit_timeout_sec.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc: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 cmd2[rabit_debug.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc: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 cmd[rabit_timeout.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:79: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 cmd1[rabit_timeout_sec.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:84: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 cmd2[rabit_debug.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:106:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[rabit_timeout.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:111: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 cmd1[rabit_timeout_sec.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:116: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 cmd2[rabit_debug.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:141:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[rabit_timeout.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:146: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 cmd1[rabit_timeout_sec.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:151: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 cmd2[rabit_debug.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:182:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[rabit_timeout.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:187: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 cmd1[rabit_timeout_sec.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:192: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 cmd2[rabit_debug.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:210:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[rabit_timeout.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:215: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 cmd1[rabit_timeout_sec.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/cpp/allreduce_robust_test.cc:220: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 cmd2[rabit_debug.size()+1]; data/rabit-0.0~git20200628.74bf00a/test/lazy_recover.cc:91:11: [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 n = atoi(argv[1]); data/rabit-0.0~git20200628.74bf00a/test/local_recover.cc:102:11: [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 n = atoi(argv[1]); data/rabit-0.0~git20200628.74bf00a/test/model_recover.cc:115:11: [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 n = atoi(argv[1]); data/rabit-0.0~git20200628.74bf00a/test/speed_test.cc:77:11: [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 n = atoi(argv[1]); data/rabit-0.0~git20200628.74bf00a/test/speed_test.cc:78:14: [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 nrep = atoi(argv[2]); data/rabit-0.0~git20200628.74bf00a/include/rabit/internal/rabit-inl.h:228:14: [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). msg.resize(strlen(msg.c_str())); data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:121: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). void* name = lookupbuf.AllocTemp(strlen(k.c_str()) + 1, 1); data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:122:37: [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). lookupbuf.PushTemp(cur_cache_seq, strlen(k.c_str()) + 1, 1); data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:123: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). std::memcpy(name, key.c_str(), strlen(k.c_str()) + 1); data/rabit-0.0~git20200628.74bf00a/src/allreduce_robust.cc:138: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 (nsize == strlen(key.c_str()) + 1 ANALYSIS SUMMARY: Hits = 103 Lines analyzed = 8612 in approximately 0.29 seconds (29771 lines/second) Physical Source Lines of Code (SLOC) = 5778 Hits@level = [0] 56 [1] 5 [2] 77 [3] 10 [4] 11 [5] 0 Hits@level+ = [0+] 159 [1+] 103 [2+] 98 [3+] 21 [4+] 11 [5+] 0 Hits/KSLOC@level+ = [0+] 27.5182 [1+] 17.8262 [2+] 16.9609 [3+] 3.63448 [4+] 1.90377 [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.