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/libmirisdr-0.0.4.59ba37/include/mirisdr.h Examining data/libmirisdr-0.0.4.59ba37/include/mirisdr_export.h Examining data/libmirisdr-0.0.4.59ba37/include/mirisdr_reg.h Examining data/libmirisdr-0.0.4.59ba37/include/tuner_msi001.h Examining data/libmirisdr-0.0.4.59ba37/src/libmirisdr.c Examining data/libmirisdr-0.0.4.59ba37/src/miri_sdr.c Examining data/libmirisdr-0.0.4.59ba37/src/tuner_msi001.c FINAL RESULTS: data/libmirisdr-0.0.4.59ba37/src/miri_sdr.c:116:16: [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 ((opt = getopt(argc, argv, "d:f:g:s:b:S::")) != -1) { data/libmirisdr-0.0.4.59ba37/src/libmirisdr.c:309:4: [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(gains, msi001_gains, len); data/libmirisdr-0.0.4.59ba37/src/miri_sdr.c:110: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 vendor[256] = { 0 }, product[256] = { 0 }, serial[256] = { 0 }; data/libmirisdr-0.0.4.59ba37/src/miri_sdr.c:119:16: [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). dev_index = atoi(optarg); data/libmirisdr-0.0.4.59ba37/src/miri_sdr.c:150:14: [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). dev_index = atoi(argv[1]); data/libmirisdr-0.0.4.59ba37/src/miri_sdr.c:151:14: [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). samp_rate = atoi(argv[2])*1000; data/libmirisdr-0.0.4.59ba37/src/miri_sdr.c:153:14: [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). frequency = atoi(argv[4]); data/libmirisdr-0.0.4.59ba37/src/miri_sdr.c:253:10: [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). file = fopen(filename, "wb"); ANALYSIS SUMMARY: Hits = 8 Lines analyzed = 1780 in approximately 0.08 seconds (22746 lines/second) Physical Source Lines of Code (SLOC) = 1189 Hits@level = [0] 51 [1] 0 [2] 7 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 59 [1+] 8 [2+] 8 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 49.6215 [1+] 6.72834 [2+] 6.72834 [3+] 0.841043 [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.