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/libbytesize-2.4/src/bs_size.c Examining data/libbytesize-2.4/src/bs_size.h Examining data/libbytesize-2.4/src/gettext.h FINAL RESULTS: data/libbytesize-2.4/src/bs_size.c:50:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char const * const b_units[BS_BUNIT_UNDEF] = { data/libbytesize-2.4/src/bs_size.c:71:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char const * const d_units[BS_DUNIT_UNDEF] = { data/libbytesize-2.4/src/bs_size.c:193: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 (ret, str, pos - str); data/libbytesize-2.4/src/bs_size.c:195: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 (dest, new, new_len); data/libbytesize-2.4/src/bs_size.c:197: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 (dest, pos + orig_len, str_len - (pos - str) - orig_len); data/libbytesize-2.4/src/gettext.h:219: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 msg_ctxt_id[msgctxt_len + msgid_len]; data/libbytesize-2.4/src/gettext.h:221:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/libbytesize-2.4/src/gettext.h:229: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 (msg_ctxt_id, msgctxt, msgctxt_len - 1); data/libbytesize-2.4/src/gettext.h:231: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 (msg_ctxt_id + msgctxt_len, msgid, msgid_len); data/libbytesize-2.4/src/gettext.h:265: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 msg_ctxt_id[msgctxt_len + msgid_len]; data/libbytesize-2.4/src/gettext.h:267:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/libbytesize-2.4/src/gettext.h:275: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 (msg_ctxt_id, msgctxt, msgctxt_len - 1); data/libbytesize-2.4/src/gettext.h:277: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 (msg_ctxt_id + msgctxt_len, msgid, msgid_len); data/libbytesize-2.4/src/bs_size.c:149:35: [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). ret = malloc (sizeof(char) * (strlen(str) + (strlen(new) - 1) * count + 1)); data/libbytesize-2.4/src/bs_size.c:149: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). ret = malloc (sizeof(char) * (strlen(str) + (strlen(new) - 1) * count + 1)); data/libbytesize-2.4/src/bs_size.c:187: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). str_len = strlen (str); data/libbytesize-2.4/src/bs_size.c:188: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). orig_len = strlen (orig); data/libbytesize-2.4/src/bs_size.c:189: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). new_len = strlen (new); data/libbytesize-2.4/src/bs_size.c:210: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). int end = strlen(str) - 1; data/libbytesize-2.4/src/bs_size.c:230:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). unit_str_len = strlen (unit_str); data/libbytesize-2.4/src/bs_size.c:477: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). str_len = strlen (loc_size_str); data/libbytesize-2.4/src/gettext.h:215:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgctxt_len = strlen (msgctxt) + 1; data/libbytesize-2.4/src/gettext.h:216:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgid_len = strlen (msgid) + 1; data/libbytesize-2.4/src/gettext.h:261:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgctxt_len = strlen (msgctxt) + 1; data/libbytesize-2.4/src/gettext.h:262:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgid_len = strlen (msgid) + 1; ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 1699 in approximately 0.07 seconds (24033 lines/second) Physical Source Lines of Code (SLOC) = 977 Hits@level = [0] 0 [1] 12 [2] 13 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 25 [1+] 25 [2+] 13 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 25.5885 [1+] 25.5885 [2+] 13.306 [3+] 0 [4+] 0 [5+] 0 Dot directories skipped = 2 (--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.