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/semodule-utils-3.1/semodule_expand/semodule_expand.c Examining data/semodule-utils-3.1/semodule_link/semodule_link.c Examining data/semodule-utils-3.1/semodule_package/semodule_package.c Examining data/semodule-utils-3.1/semodule_package/semodule_unpackage.c FINAL RESULTS: data/semodule-utils-3.1/semodule_expand/semodule_expand.c:49:15: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((ch = getopt(argc, argv, "c:Vva")) != EOF) { data/semodule-utils-3.1/semodule_link/semodule_link.c:87:15: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((ch = getopt(argc, argv, "o:Vv")) != EOF) { data/semodule-utils-3.1/semodule_package/semodule_package.c:117:14: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((i = getopt_long(argc, argv, "m:f:s:u:o:n:h", opts, NULL)) != -1) { data/semodule-utils-3.1/semodule_expand/semodule_expand.c:123:7: [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). fp = fopen(basename, "r"); data/semodule-utils-3.1/semodule_expand/semodule_expand.c:169: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). outfile = fopen(outname, "w"); data/semodule-utils-3.1/semodule_link/semodule_link.c:50:7: [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). fp = fopen(filename, "r"); data/semodule-utils-3.1/semodule_link/semodule_link.c:151:13: [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). outfile = fopen(outname, "w"); data/semodule-utils-3.1/semodule_package/semodule_package.c:50:6: [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). f = fopen(filename, mode); data/semodule-utils-3.1/semodule_package/semodule_package.c:64:7: [2] (misc) open: 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). fd = open(path, O_RDONLY); data/semodule-utils-3.1/semodule_package/semodule_unpackage.c:32:6: [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). f = fopen(filename, mode); data/semodule-utils-3.1/semodule_package/semodule_unpackage.c:88:8: [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). fp = fopen(fcfile, "w"); ANALYSIS SUMMARY: Hits = 11 Lines analyzed = 731 in approximately 0.05 seconds (14441 lines/second) Physical Source Lines of Code (SLOC) = 614 Hits@level = [0] 59 [1] 0 [2] 8 [3] 3 [4] 0 [5] 0 Hits@level+ = [0+] 70 [1+] 11 [2+] 11 [3+] 3 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 114.007 [1+] 17.9153 [2+] 17.9153 [3+] 4.88599 [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.