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/wannier90-3.1.0+ds/utility/w90pov/src/write_df3.c FINAL RESULTS: data/wannier90-3.1.0+ds/utility/w90pov/src/write_df3.c:26: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 cvec[sizeof(int)/sizeof(char)]; data/wannier90-3.1.0+ds/utility/w90pov/src/write_df3.c: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 filenamep[30]; data/wannier90-3.1.0+ds/utility/w90pov/src/write_df3.c:59: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 filenamem[30]; data/wannier90-3.1.0+ds/utility/w90pov/src/write_df3.c:74:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(filenamep,"wan_%3.3dp.df3",*num); data/wannier90-3.1.0+ds/utility/w90pov/src/write_df3.c:75:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(filenamem,"wan_%3.3dm.df3",*num); data/wannier90-3.1.0+ds/utility/w90pov/src/write_df3.c:79:12: [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((pekp=fopen(filenamep,"wb"))==NULL) { data/wannier90-3.1.0+ds/utility/w90pov/src/write_df3.c:82:12: [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((pekm=fopen(filenamem,"wb"))==NULL) { ANALYSIS SUMMARY: Hits = 7 Lines analyzed = 150 in approximately 0.14 seconds (1100 lines/second) Physical Source Lines of Code (SLOC) = 105 Hits@level = [0] 9 [1] 0 [2] 7 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 16 [1+] 7 [2+] 7 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 152.381 [1+] 66.6667 [2+] 66.6667 [3+] 0 [4+] 0 [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.