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/mpdecimal-2.5.0/tests/runtest.c Examining data/mpdecimal-2.5.0/tests/malloc_fail.h Examining data/mpdecimal-2.5.0/tests/malloc_fail.c Examining data/mpdecimal-2.5.0/tests++/runtest.cc Examining data/mpdecimal-2.5.0/tests++/malloc_fail.cc Examining data/mpdecimal-2.5.0/tests++/apitest.cc Examining data/mpdecimal-2.5.0/libmpdec/vccompat.h Examining data/mpdecimal-2.5.0/libmpdec/umodarith.h Examining data/mpdecimal-2.5.0/libmpdec/typearith.h Examining data/mpdecimal-2.5.0/libmpdec/transpose.h Examining data/mpdecimal-2.5.0/libmpdec/transpose.c Examining data/mpdecimal-2.5.0/libmpdec/sixstep.h Examining data/mpdecimal-2.5.0/libmpdec/sixstep.c Examining data/mpdecimal-2.5.0/libmpdec/numbertheory.h Examining data/mpdecimal-2.5.0/libmpdec/numbertheory.c Examining data/mpdecimal-2.5.0/libmpdec/mpsignal.c Examining data/mpdecimal-2.5.0/libmpdec/mpdecimal64vc.h Examining data/mpdecimal-2.5.0/libmpdec/mpdecimal32vc.h Examining data/mpdecimal-2.5.0/libmpdec/mpdecimal.c Examining data/mpdecimal-2.5.0/libmpdec/mpalloc.h Examining data/mpdecimal-2.5.0/libmpdec/mpalloc.c Examining data/mpdecimal-2.5.0/libmpdec/io.h Examining data/mpdecimal-2.5.0/libmpdec/io.c Examining data/mpdecimal-2.5.0/libmpdec/fourstep.h Examining data/mpdecimal-2.5.0/libmpdec/fourstep.c Examining data/mpdecimal-2.5.0/libmpdec/fnt.h Examining data/mpdecimal-2.5.0/libmpdec/fnt.c Examining data/mpdecimal-2.5.0/libmpdec/examples/sqrt.c Examining data/mpdecimal-2.5.0/libmpdec/examples/shift.c Examining data/mpdecimal-2.5.0/libmpdec/examples/powmod.c Examining data/mpdecimal-2.5.0/libmpdec/examples/pow.c Examining data/mpdecimal-2.5.0/libmpdec/examples/multiply.c Examining data/mpdecimal-2.5.0/libmpdec/examples/divmod.c Examining data/mpdecimal-2.5.0/libmpdec/examples/div.c Examining data/mpdecimal-2.5.0/libmpdec/examples/compare.c Examining data/mpdecimal-2.5.0/libmpdec/difradix2.h Examining data/mpdecimal-2.5.0/libmpdec/difradix2.c Examining data/mpdecimal-2.5.0/libmpdec/crt.h Examining data/mpdecimal-2.5.0/libmpdec/crt.c Examining data/mpdecimal-2.5.0/libmpdec/convolute.h Examining data/mpdecimal-2.5.0/libmpdec/convolute.c Examining data/mpdecimal-2.5.0/libmpdec/context.c Examining data/mpdecimal-2.5.0/libmpdec/constants.h Examining data/mpdecimal-2.5.0/libmpdec/constants.c Examining data/mpdecimal-2.5.0/libmpdec/bits.h Examining data/mpdecimal-2.5.0/libmpdec/bench_full.c Examining data/mpdecimal-2.5.0/libmpdec/bench.c Examining data/mpdecimal-2.5.0/libmpdec/basearith.h Examining data/mpdecimal-2.5.0/libmpdec/basearith.c Examining data/mpdecimal-2.5.0/libmpdec++/examples/pi.cc Examining data/mpdecimal-2.5.0/libmpdec++/examples/factorial.cc Examining data/mpdecimal-2.5.0/libmpdec++/decimal.cc Examining data/mpdecimal-2.5.0/libmpdec++/bench_full.cc Examining data/mpdecimal-2.5.0/libmpdec++/bench.cc FINAL RESULTS: data/mpdecimal-2.5.0/libmpdec/mpdecimal32vc.h:698:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, __VA_ARGS__); fputc('\n', stderr); \ data/mpdecimal-2.5.0/libmpdec/mpdecimal32vc.h:703:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, __VA_ARGS__); fputc('\n', stderr); \ data/mpdecimal-2.5.0/libmpdec/mpdecimal64vc.h:704:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, __VA_ARGS__); fputc('\n', stderr); \ data/mpdecimal-2.5.0/libmpdec/mpdecimal64vc.h:709:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, __VA_ARGS__); fputc('\n', stderr); \ data/mpdecimal-2.5.0/libmpdec/vccompat.h:43:10: [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. #undef snprintf data/mpdecimal-2.5.0/libmpdec/vccompat.h:44:11: [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/mpdecimal-2.5.0/tests++/runtest.cc:1826:5: [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. snprintf(calc, 23, "%" PRIu64, u64); data/mpdecimal-2.5.0/tests++/runtest.cc:1852:5: [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. snprintf(calc, sizeof calc, "%" PRIu32, u32); data/mpdecimal-2.5.0/tests++/runtest.cc:1878:5: [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. snprintf(calc, sizeof calc, "%" PRIi64, i64); data/mpdecimal-2.5.0/tests++/runtest.cc:1904:5: [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. snprintf(calc, sizeof calc, "%" PRIi32, i32); data/mpdecimal-2.5.0/tests/runtest.c:497:9: [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(token[n], cp); data/mpdecimal-2.5.0/tests/runtest.c:4496:5: [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. snprintf(calc, 23, "%" PRIu64, calc_uint); data/mpdecimal-2.5.0/tests/runtest.c:4536:5: [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. snprintf(calc, 23, "%" PRIu32, calc_uint); data/mpdecimal-2.5.0/tests/runtest.c:4576:5: [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. snprintf(calc, 23, "%" PRIi64, calc_ssize); data/mpdecimal-2.5.0/tests/runtest.c:4617:5: [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. snprintf(calc, 23, "%" PRIi32, calc_ssize); data/mpdecimal-2.5.0/tests/runtest.c:4667:9: [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(tmpline, line); data/mpdecimal-2.5.0/libmpdec/vccompat.h:39:10: [3] (random) random: 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. #undef random data/mpdecimal-2.5.0/libmpdec/vccompat.h:40:11: [3] (random) random: 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. #define random rand data/mpdecimal-2.5.0/libmpdec/vccompat.h:41:10: [3] (random) srandom: 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. #undef srandom data/mpdecimal-2.5.0/libmpdec/vccompat.h:42:11: [3] (random) srandom: 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. #define srandom srand data/mpdecimal-2.5.0/libmpdec/vccompat.h:42:19: [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. #define srandom srand data/mpdecimal-2.5.0/tests++/apitest.cc:2759: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((unsigned int)time(NULL)); data/mpdecimal-2.5.0/tests++/runtest.cc:372:14: [3] (random) random: 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. long r = random() % 100; data/mpdecimal-2.5.0/tests++/runtest.cc:373:20: [3] (random) random: 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. uint8_t sign = random() % 2; data/mpdecimal-2.5.0/tests++/runtest.cc:1031:24: [3] (random) random: 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. incr = random() % 100 + 1; data/mpdecimal-2.5.0/tests++/runtest.cc:1089:24: [3] (random) random: 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. incr = random() % 100 + 1; data/mpdecimal-2.5.0/tests++/runtest.cc:1182:23: [3] (random) random: 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. incr = random() % 100 + 1; data/mpdecimal-2.5.0/tests++/runtest.cc:1271:24: [3] (random) random: 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. incr = random() % 100 + 1; data/mpdecimal-2.5.0/tests++/runtest.cc:1368:24: [3] (random) random: 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. incr = random() % 100 + 1; data/mpdecimal-2.5.0/tests++/runtest.cc:2729: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((unsigned int)time(NULL)); data/mpdecimal-2.5.0/tests/runtest.c:87:14: [3] (random) random: 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. long r = random() % 100; data/mpdecimal-2.5.0/tests/runtest.c:88:20: [3] (random) random: 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. uint8_t sign = random()%2; data/mpdecimal-2.5.0/tests/runtest.c:4065:16: [3] (random) random: 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. base = random() % UINT16_MAX; data/mpdecimal-2.5.0/tests/runtest.c:4379:16: [3] (random) random: 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. base = random() % UINT32_MAX; data/mpdecimal-2.5.0/tests/runtest.c:5343: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((unsigned int)time(NULL)); data/mpdecimal-2.5.0/libmpdec/constants.c:114:7: [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. const char *mpd_round_string[MPD_ROUND_GUARD] = { data/mpdecimal-2.5.0/libmpdec/constants.c:126:7: [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. const char *mpd_clamp_string[MPD_CLAMP_GUARD] = { data/mpdecimal-2.5.0/libmpdec/examples/compare.c:42: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 status_str[MPD_MAX_FLAG_STRING]; data/mpdecimal-2.5.0/libmpdec/examples/div.c:42: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 status_str[MPD_MAX_FLAG_STRING]; data/mpdecimal-2.5.0/libmpdec/examples/divmod.c:42: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 status_str[MPD_MAX_FLAG_STRING]; data/mpdecimal-2.5.0/libmpdec/examples/multiply.c:42: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 status_str[MPD_MAX_FLAG_STRING]; data/mpdecimal-2.5.0/libmpdec/examples/pow.c:42: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 status_str[MPD_MAX_FLAG_STRING]; data/mpdecimal-2.5.0/libmpdec/examples/powmod.c:42: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 status_str[MPD_MAX_FLAG_STRING]; data/mpdecimal-2.5.0/libmpdec/examples/shift.c:42: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 status_str[MPD_MAX_FLAG_STRING]; data/mpdecimal-2.5.0/libmpdec/examples/sqrt.c:42: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 status_str[MPD_MAX_FLAG_STRING]; data/mpdecimal-2.5.0/libmpdec/io.c:493:17: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(cp, "NaN"); data/mpdecimal-2.5.0/libmpdec/io.c:497:17: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(cp, "sNaN"); data/mpdecimal-2.5.0/libmpdec/io.c:505:13: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(cp, "Infinity"); data/mpdecimal-2.5.0/libmpdec/io.c:690:16: [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. _mpd_copy_utf8(char dest[5], const char *s) data/mpdecimal-2.5.0/libmpdec/io.c:1428:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char *mpd_flag_string[MPD_NUM_FLAGS] = { data/mpdecimal-2.5.0/libmpdec/io.c:1446:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char *mpd_signal_string[MPD_NUM_FLAGS] = { data/mpdecimal-2.5.0/libmpdec/mpalloc.c:234: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(result->data, p, result->alloc * (sizeof *result->data)); data/mpdecimal-2.5.0/libmpdec/mpalloc.c:320: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(data, result->data, result->alloc * (sizeof *result->data)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:2012: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(result->data, a->data, a->len * (sizeof *result->data)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:2031: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(result->data, a->data, a->len * (sizeof *result->data)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:2045: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(result->data, a->data, a->len * (sizeof *result->data)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:2065: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(result->data, a->data, a->len * (sizeof *result->data)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:5495: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(w, a, m * sizeof *w); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:5499: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(w+(m+1), b, m * sizeof *w); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:5679: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(c1, u, ulen * (sizeof *c1)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:5680: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(c2, u, ulen * (sizeof *c2)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:5681: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(c3, u, ulen * (sizeof *c3)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:5695:9: [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(vtmp, v, vlen * (sizeof *vtmp)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:5701:9: [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(vtmp, v, vlen * (sizeof *vtmp)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:5708:9: [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(vtmp, v, vlen * (sizeof *vtmp)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:5759:13: [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(c, result, (la+lb) * (sizeof *result)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:5798: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(w, a, m * sizeof *w); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:5802: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(w+(m+1), b, m * sizeof *w); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:8252: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(*w, u, ulen * (sizeof **w)); data/mpdecimal-2.5.0/libmpdec/mpdecimal.c:8622:9: [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(result->data, srcdata, srclen * (sizeof *srcdata)); data/mpdecimal-2.5.0/libmpdec/mpdecimal32vc.h:169: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. IMPORTEXPORT extern const char *mpd_round_string[MPD_ROUND_GUARD]; data/mpdecimal-2.5.0/libmpdec/mpdecimal32vc.h:170: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. IMPORTEXPORT extern const char *mpd_clamp_string[MPD_CLAMP_GUARD]; data/mpdecimal-2.5.0/libmpdec/mpdecimal32vc.h:309: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 fill[5]; /* fill character */ data/mpdecimal-2.5.0/libmpdec/mpdecimal64vc.h:164: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. IMPORTEXPORT extern const char *mpd_round_string[MPD_ROUND_GUARD]; data/mpdecimal-2.5.0/libmpdec/mpdecimal64vc.h:165: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. IMPORTEXPORT extern const char *mpd_clamp_string[MPD_CLAMP_GUARD]; data/mpdecimal-2.5.0/libmpdec/mpdecimal64vc.h:304: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 fill[5]; /* fill character */ data/mpdecimal-2.5.0/libmpdec/transpose.c:120:13: [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(readbuf, hp+offset, stride*(sizeof *readbuf)); data/mpdecimal-2.5.0/libmpdec/transpose.c:128:17: [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(readbuf, hp+offset, stride*(sizeof *readbuf)); data/mpdecimal-2.5.0/libmpdec/transpose.c:129:17: [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(hp+offset, writebuf, stride*(sizeof *writebuf)); data/mpdecimal-2.5.0/libmpdec/transpose.c:139:13: [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(hp+offset, writebuf, stride*(sizeof *writebuf)); data/mpdecimal-2.5.0/libmpdec/transpose.c:195:17: [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(to, from, b*(sizeof *to)); data/mpdecimal-2.5.0/libmpdec/transpose.c:205:21: [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(to, from, b*(sizeof *to)); data/mpdecimal-2.5.0/libmpdec/transpose.c:215:21: [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(to, from, b*(sizeof *to)); data/mpdecimal-2.5.0/libmpdec/transpose.c:224:21: [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(to, from, b*(sizeof *to)); data/mpdecimal-2.5.0/libmpdec/transpose.c:232:21: [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(to, from, b*(sizeof *to)); data/mpdecimal-2.5.0/tests++/apitest.cc:1733: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[10]; data/mpdecimal-2.5.0/tests++/runtest.cc:615: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 ctxstatus[MPD_MAX_FLAG_STRING]; data/mpdecimal-2.5.0/tests++/runtest.cc:616: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 expstatus[MPD_MAX_FLAG_STRING]; data/mpdecimal-2.5.0/tests++/runtest.cc:858: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 hex[5]; data/mpdecimal-2.5.0/tests++/runtest.cc:1575: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[11]; data/mpdecimal-2.5.0/tests++/runtest.cc:1649: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[11]; data/mpdecimal-2.5.0/tests++/runtest.cc:1811: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 calc[23]; data/mpdecimal-2.5.0/tests++/runtest.cc:1838: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 calc[23]; data/mpdecimal-2.5.0/tests++/runtest.cc:1864: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 calc[23]; data/mpdecimal-2.5.0/tests++/runtest.cc:1890: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 calc[23]; data/mpdecimal-2.5.0/tests/runtest.c:568: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 ctxstatus[MPD_MAX_FLAG_STRING]; data/mpdecimal-2.5.0/tests/runtest.c:569: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 expstatus[MPD_MAX_FLAG_STRING]; data/mpdecimal-2.5.0/tests/runtest.c:1011: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 hex[5]; data/mpdecimal-2.5.0/tests/runtest.c:2912: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[11]; data/mpdecimal-2.5.0/tests/runtest.c:3077: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[11]; data/mpdecimal-2.5.0/tests/runtest.c:3184: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[11]; data/mpdecimal-2.5.0/tests/runtest.c:3349: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[11]; data/mpdecimal-2.5.0/tests/runtest.c:3454: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[11]; data/mpdecimal-2.5.0/tests/runtest.c:3519: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[11]; data/mpdecimal-2.5.0/tests/runtest.c:3577: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[11]; data/mpdecimal-2.5.0/tests/runtest.c:3637: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[11]; data/mpdecimal-2.5.0/tests/runtest.c:4478: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 calc[23]; data/mpdecimal-2.5.0/tests/runtest.c:4518: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 calc[23]; data/mpdecimal-2.5.0/tests/runtest.c:4558: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 calc[23]; data/mpdecimal-2.5.0/tests/runtest.c:4599: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 calc[23]; data/mpdecimal-2.5.0/tests/runtest.c:4633: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 *token[MAXTOKEN+1]; data/mpdecimal-2.5.0/tests/runtest.c:4647:21: [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 ((file = fopen(filename, "r")) == NULL) { data/mpdecimal-2.5.0/tests/runtest.c:4828:13: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(token[1], "powmod"); data/mpdecimal-2.5.0/libmpdec/io.c:777:9: [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(spec->dot); data/mpdecimal-2.5.0/libmpdec/io.c:781:9: [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(spec->sep) > 4) { data/mpdecimal-2.5.0/libmpdec/io.c:999:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n_sep = (mpd_ssize_t)strlen(spec->sep); data/mpdecimal-2.5.0/libmpdec/io.c:1008:50: [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). _mbstr_copy_char(dest, dot, (mpd_ssize_t)strlen(dot)); data/mpdecimal-2.5.0/libmpdec/io.c:1161: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). n_fill = strlen(spec->fill); data/mpdecimal-2.5.0/libmpdec/io.c:1284:16: [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). assert(strlen(spec->fill) == 1); /* annotation for scan-build */ data/mpdecimal-2.5.0/tests++/malloc_fail.cc:47:22: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. if (size > test::ulimit) return NULL; data/mpdecimal-2.5.0/tests++/malloc_fail.cc:63:23: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. if (nmemb > test::ulimit / size) return NULL; data/mpdecimal-2.5.0/tests++/malloc_fail.cc:79:22: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. if (size > test::ulimit) return NULL; data/mpdecimal-2.5.0/tests++/runtest.cc:407:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strncasecmp(s.c_str(), prefix, strlen(prefix)) == 0; data/mpdecimal-2.5.0/tests++/runtest.cc:863:40: [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::shared_ptr<char> ptr(new char[strlen(s)+1], std::default_delete<char[]>()); data/mpdecimal-2.5.0/tests/malloc_fail.c:51:17: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. if (size > ulimit) return NULL; data/mpdecimal-2.5.0/tests/malloc_fail.c:62:18: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. if (nmemb > ulimit / size) return NULL; data/mpdecimal-2.5.0/tests/malloc_fail.c:73:17: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. if (size > ulimit) return NULL; data/mpdecimal-2.5.0/tests/malloc_fail.c:85:17: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. if (size > ulimit) return NULL; data/mpdecimal-2.5.0/tests/malloc_fail.c:100:18: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. if (nmemb > ulimit / size) return NULL; data/mpdecimal-2.5.0/tests/malloc_fail.c:120:17: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. if (size > ulimit) return NULL; data/mpdecimal-2.5.0/tests/malloc_fail.h:39:15: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. extern size_t ulimit; data/mpdecimal-2.5.0/tests/runtest.c:401:51: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return token != NULL && strncasecmp(token, s, strlen(s)) == 0; data/mpdecimal-2.5.0/tests/runtest.c:493:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(cp); data/mpdecimal-2.5.0/tests/runtest.c:856: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). ASSERT(size == (mpd_ssize_t)strlen(s)) data/mpdecimal-2.5.0/tests/runtest.c:980: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). ASSERT(size == (mpd_ssize_t)strlen(calc)); data/mpdecimal-2.5.0/tests/runtest.c:997:41: [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). ASSERT(size == (mpd_ssize_t)strlen(calc)); data/mpdecimal-2.5.0/tests/runtest.c:1016:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cp = res = malloc(strlen(s)+1); ANALYSIS SUMMARY: Hits = 137 Lines analyzed = 31038 in approximately 0.84 seconds (36883 lines/second) Physical Source Lines of Code (SLOC) = 22156 Hits@level = [0] 84 [1] 24 [2] 78 [3] 19 [4] 16 [5] 0 Hits@level+ = [0+] 221 [1+] 137 [2+] 113 [3+] 35 [4+] 16 [5+] 0 Hits/KSLOC@level+ = [0+] 9.97472 [1+] 6.18343 [2+] 5.1002 [3+] 1.57971 [4+] 0.722152 [5+] 0 Dot directories skipped = 3 (--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.