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/c2hs-0.28.6/src/C2HS/config.c Examining data/c2hs-0.28.6/src/C2HS/config.h Examining data/c2hs-0.28.6/tests/bugs/call_capital/Capital.h Examining data/c2hs-0.28.6/tests/bugs/call_capital/Capital.c Examining data/c2hs-0.28.6/tests/bugs/issue-10/issue10.h Examining data/c2hs-0.28.6/tests/bugs/issue-10/issue10.c Examining data/c2hs-0.28.6/tests/bugs/issue-103/issue103.h Examining data/c2hs-0.28.6/tests/bugs/issue-103/issue103.c Examining data/c2hs-0.28.6/tests/bugs/issue-113/issue113.h Examining data/c2hs-0.28.6/tests/bugs/issue-113/issue113.c Examining data/c2hs-0.28.6/tests/bugs/issue-115/issue115.h Examining data/c2hs-0.28.6/tests/bugs/issue-115/issue115.c Examining data/c2hs-0.28.6/tests/bugs/issue-116/issue116.h Examining data/c2hs-0.28.6/tests/bugs/issue-116/issue116.c Examining data/c2hs-0.28.6/tests/bugs/issue-117/issue117.h Examining data/c2hs-0.28.6/tests/bugs/issue-117/issue117.c Examining data/c2hs-0.28.6/tests/bugs/issue-123/issue123.h Examining data/c2hs-0.28.6/tests/bugs/issue-123/issue123.c Examining data/c2hs-0.28.6/tests/bugs/issue-127/issue127.h Examining data/c2hs-0.28.6/tests/bugs/issue-127/issue127.c Examining data/c2hs-0.28.6/tests/bugs/issue-128/issue128.h Examining data/c2hs-0.28.6/tests/bugs/issue-128/issue128.c Examining data/c2hs-0.28.6/tests/bugs/issue-130/issue130.h Examining data/c2hs-0.28.6/tests/bugs/issue-130/issue130.c Examining data/c2hs-0.28.6/tests/bugs/issue-131/issue131.h Examining data/c2hs-0.28.6/tests/bugs/issue-131/issue131.c Examining data/c2hs-0.28.6/tests/bugs/issue-133/issue133.h Examining data/c2hs-0.28.6/tests/bugs/issue-134/issue134.h Examining data/c2hs-0.28.6/tests/bugs/issue-136/issue136.h Examining data/c2hs-0.28.6/tests/bugs/issue-136/issue136.c Examining data/c2hs-0.28.6/tests/bugs/issue-140/issue140.h Examining data/c2hs-0.28.6/tests/bugs/issue-140/issue140.c Examining data/c2hs-0.28.6/tests/bugs/issue-141/issue141.h Examining data/c2hs-0.28.6/tests/bugs/issue-149/issue149.h Examining data/c2hs-0.28.6/tests/bugs/issue-149/issue149.c Examining data/c2hs-0.28.6/tests/bugs/issue-15/issue15.h Examining data/c2hs-0.28.6/tests/bugs/issue-15/issue15.c Examining data/c2hs-0.28.6/tests/bugs/issue-151/issue151.h Examining data/c2hs-0.28.6/tests/bugs/issue-152/issue152.h Examining data/c2hs-0.28.6/tests/bugs/issue-155/types.h Examining data/c2hs-0.28.6/tests/bugs/issue-16/issue16.h Examining data/c2hs-0.28.6/tests/bugs/issue-16/issue16.c Examining data/c2hs-0.28.6/tests/bugs/issue-180/issue180.h Examining data/c2hs-0.28.6/tests/bugs/issue-19/issue19.h Examining data/c2hs-0.28.6/tests/bugs/issue-19/issue19.c Examining data/c2hs-0.28.6/tests/bugs/issue-192/issue-192.h Examining data/c2hs-0.28.6/tests/bugs/issue-20/issue20.h Examining data/c2hs-0.28.6/tests/bugs/issue-20/issue20.c Examining data/c2hs-0.28.6/tests/bugs/issue-22/issue22.h Examining data/c2hs-0.28.6/tests/bugs/issue-22/issue22.c Examining data/c2hs-0.28.6/tests/bugs/issue-23/issue23x.h Examining data/c2hs-0.28.6/tests/bugs/issue-23/issue23.h Examining data/c2hs-0.28.6/tests/bugs/issue-23/issue23.c Examining data/c2hs-0.28.6/tests/bugs/issue-29/issue29.h Examining data/c2hs-0.28.6/tests/bugs/issue-30/issue30aux1.h Examining data/c2hs-0.28.6/tests/bugs/issue-30/issue30aux2.h Examining data/c2hs-0.28.6/tests/bugs/issue-30/issue30.h Examining data/c2hs-0.28.6/tests/bugs/issue-30/issue30aux1.c Examining data/c2hs-0.28.6/tests/bugs/issue-30/issue30aux2.c Examining data/c2hs-0.28.6/tests/bugs/issue-30/issue30.c Examining data/c2hs-0.28.6/tests/bugs/issue-31/issue31.h Examining data/c2hs-0.28.6/tests/bugs/issue-31/issue31.c Examining data/c2hs-0.28.6/tests/bugs/issue-32/issue32.h Examining data/c2hs-0.28.6/tests/bugs/issue-32/issue32.c Examining data/c2hs-0.28.6/tests/bugs/issue-36/issue36.h Examining data/c2hs-0.28.6/tests/bugs/issue-38/issue38.h Examining data/c2hs-0.28.6/tests/bugs/issue-38/issue38.c Examining data/c2hs-0.28.6/tests/bugs/issue-43/issue43.h Examining data/c2hs-0.28.6/tests/bugs/issue-43/issue43.c Examining data/c2hs-0.28.6/tests/bugs/issue-44/issue44.h Examining data/c2hs-0.28.6/tests/bugs/issue-44/issue44.c Examining data/c2hs-0.28.6/tests/bugs/issue-45/issue45.h Examining data/c2hs-0.28.6/tests/bugs/issue-45/issue45.c Examining data/c2hs-0.28.6/tests/bugs/issue-46/issue46.h Examining data/c2hs-0.28.6/tests/bugs/issue-46/issue46.c Examining data/c2hs-0.28.6/tests/bugs/issue-47/issue47.h Examining data/c2hs-0.28.6/tests/bugs/issue-47/issue47.c Examining data/c2hs-0.28.6/tests/bugs/issue-48/issue48.h Examining data/c2hs-0.28.6/tests/bugs/issue-48/issue48.c Examining data/c2hs-0.28.6/tests/bugs/issue-51/issue51.h Examining data/c2hs-0.28.6/tests/bugs/issue-51/issue51.c Examining data/c2hs-0.28.6/tests/bugs/issue-54/issue54.h Examining data/c2hs-0.28.6/tests/bugs/issue-54/issue54.c Examining data/c2hs-0.28.6/tests/bugs/issue-60/_mingw.h Examining data/c2hs-0.28.6/tests/bugs/issue-60/stdlib.h Examining data/c2hs-0.28.6/tests/bugs/issue-60/issue60.c Examining data/c2hs-0.28.6/tests/bugs/issue-62/issue62.h Examining data/c2hs-0.28.6/tests/bugs/issue-62/issue62.c Examining data/c2hs-0.28.6/tests/bugs/issue-65/issue65.h Examining data/c2hs-0.28.6/tests/bugs/issue-65/issue65.c Examining data/c2hs-0.28.6/tests/bugs/issue-69/issue69.h Examining data/c2hs-0.28.6/tests/bugs/issue-69/issue69.c Examining data/c2hs-0.28.6/tests/bugs/issue-7/issue7.h Examining data/c2hs-0.28.6/tests/bugs/issue-70/issue70.h Examining data/c2hs-0.28.6/tests/bugs/issue-70/issue70.c Examining data/c2hs-0.28.6/tests/bugs/issue-73/issue73.h Examining data/c2hs-0.28.6/tests/bugs/issue-73/issue73.c Examining data/c2hs-0.28.6/tests/bugs/issue-75/issue75.h Examining data/c2hs-0.28.6/tests/bugs/issue-75/sndfile.h Examining data/c2hs-0.28.6/tests/bugs/issue-75/issue75.c Examining data/c2hs-0.28.6/tests/bugs/issue-79/issue79.h Examining data/c2hs-0.28.6/tests/bugs/issue-79/issue79.c Examining data/c2hs-0.28.6/tests/bugs/issue-80/issue80.h Examining data/c2hs-0.28.6/tests/bugs/issue-80/issue80.c Examining data/c2hs-0.28.6/tests/bugs/issue-9/issue9.h Examining data/c2hs-0.28.6/tests/bugs/issue-9/issue9.c Examining data/c2hs-0.28.6/tests/bugs/issue-93/issue93.h Examining data/c2hs-0.28.6/tests/bugs/issue-93/issue93.c Examining data/c2hs-0.28.6/tests/bugs/issue-95/issue95.h Examining data/c2hs-0.28.6/tests/bugs/issue-95/issue95.c Examining data/c2hs-0.28.6/tests/bugs/issue-96/issue96.h Examining data/c2hs-0.28.6/tests/bugs/issue-96/issue96.c Examining data/c2hs-0.28.6/tests/bugs/issue-97/issue97.h Examining data/c2hs-0.28.6/tests/bugs/issue-97/issue97.c Examining data/c2hs-0.28.6/tests/bugs/issue-98/issue98.h Examining data/c2hs-0.28.6/tests/bugs/issue-98/issue98.c Examining data/c2hs-0.28.6/tests/system/calls/calls.h Examining data/c2hs-0.28.6/tests/system/enums/enums.h Examining data/c2hs-0.28.6/tests/system/enums/enums.c Examining data/c2hs-0.28.6/tests/system/marsh/marsh.h Examining data/c2hs-0.28.6/tests/system/pointer/pointer.h Examining data/c2hs-0.28.6/tests/system/pointer/pointer.c Examining data/c2hs-0.28.6/tests/system/simple/simple.h Examining data/c2hs-0.28.6/tests/system/simple/simple.c Examining data/c2hs-0.28.6/tests/system/sizeof/sizeof.h Examining data/c2hs-0.28.6/tests/system/sizeof/sizeof.c Examining data/c2hs-0.28.6/tests/system/structs/structs.h Examining data/c2hs-0.28.6/tests/system/structs/structs.c FINAL RESULTS: data/c2hs-0.28.6/tests/bugs/issue-60/stdlib.h:365:37: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. _CRTIMP int __cdecl __MINGW_NOTHROW system (const char*); data/c2hs-0.28.6/tests/bugs/issue-60/stdlib.h:353:38: [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. _CRTIMP void __cdecl __MINGW_NOTHROW srand (unsigned int); data/c2hs-0.28.6/tests/bugs/issue-60/stdlib.h:366:39: [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. _CRTIMP char* __cdecl __MINGW_NOTHROW getenv (const char*); data/c2hs-0.28.6/tests/bugs/issue-22/issue22.c:9:3: [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(s.somefield, "abcdef"); data/c2hs-0.28.6/tests/bugs/issue-22/issue22.h:6: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 somefield[32]; data/c2hs-0.28.6/tests/bugs/issue-60/stdlib.h:304:37: [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). _CRTIMP int __cdecl __MINGW_NOTHROW atoi (const char*); data/c2hs-0.28.6/tests/bugs/issue-60/stdlib.h:305:39: [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). _CRTIMP long __cdecl __MINGW_NOTHROW atol (const char*); data/c2hs-0.28.6/tests/bugs/issue-60/stdlib.h:308:37: [2] (integer) _wtoi: 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). _CRTIMP int __cdecl __MINGW_NOTHROW _wtoi (const wchar_t *); data/c2hs-0.28.6/tests/bugs/issue-60/stdlib.h:431:41: [2] (integer) _wtoi64: 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). _CRTIMP __int64 __cdecl __MINGW_NOTHROW _wtoi64(const wchar_t *); data/c2hs-0.28.6/tests/bugs/issue-60/stdlib.h:535:12: [2] (integer) _wtoi64: 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 _wtoi64 (_w); } data/c2hs-0.28.6/tests/bugs/issue-75/sndfile.h:442:6: [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 description [256] ; \ data/c2hs-0.28.6/tests/bugs/issue-75/sndfile.h:443: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 originator [32] ; \ data/c2hs-0.28.6/tests/bugs/issue-75/sndfile.h:444: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 originator_reference [32] ; \ data/c2hs-0.28.6/tests/bugs/issue-75/sndfile.h:445: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 origination_date [10] ; \ data/c2hs-0.28.6/tests/bugs/issue-75/sndfile.h:446: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 origination_time [8] ; \ data/c2hs-0.28.6/tests/bugs/issue-75/sndfile.h:450: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 umid [64] ; \ data/c2hs-0.28.6/tests/bugs/issue-75/sndfile.h:451: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 reserved [190] ; \ data/c2hs-0.28.6/tests/bugs/issue-75/sndfile.h:453: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 coding_history [coding_hist_size] ; \ data/c2hs-0.28.6/tests/bugs/issue-9/issue9.h:9: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. typedef char inner_t[32]; data/c2hs-0.28.6/tests/bugs/issue-9/issue9.h:17: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 first[32]; data/c2hs-0.28.6/tests/bugs/issue-9/issue9.h:18: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 second[32]; data/c2hs-0.28.6/tests/bugs/issue-75/sndfile.h:471:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). sf_vio_read read ; ANALYSIS SUMMARY: Hits = 22 Lines analyzed = 2800 in approximately 0.18 seconds (15777 lines/second) Physical Source Lines of Code (SLOC) = 1823 Hits@level = [0] 12 [1] 1 [2] 18 [3] 2 [4] 1 [5] 0 Hits@level+ = [0+] 34 [1+] 22 [2+] 21 [3+] 3 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 18.6506 [1+] 12.068 [2+] 11.5195 [3+] 1.64564 [4+] 0.548546 [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.