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/randomsound-0.2/asoundrunner.h Examining data/randomsound-0.2/bitbuffer.c Examining data/randomsound-0.2/bitbuffer.h Examining data/randomsound-0.2/debias.c Examining data/randomsound-0.2/debias.h Examining data/randomsound-0.2/randomsound.c Examining data/randomsound-0.2/asoundrunner.c FINAL RESULTS: data/randomsound-0.2/asoundrunner.c:63:5: [4] (shell) execlp: 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. execlp("arecord", "arecord", "-c", "1", "-f", "S16_LE", "-r", SAMPLERATESTR, "-t", "raw", NULL); data/randomsound-0.2/randomsound.c:184:17: [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, ":hDp:vVm:M:b:d:")) != -1) { data/randomsound-0.2/asoundrunner.c:53:15: [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). sparefd = open("/dev/null", O_RDWR); data/randomsound-0.2/randomsound.c:202:22: [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). minwatermark = atoi(optarg); data/randomsound-0.2/randomsound.c:205:22: [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). maxwatermark = atoi(optarg); data/randomsound-0.2/randomsound.c:208:20: [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). buffersize = atoi(optarg); data/randomsound-0.2/randomsound.c:211:21: [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). depositsize = atoi(optarg); data/randomsound-0.2/randomsound.c:260:14: [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). randomfd = open("/dev/random", O_RDWR); data/randomsound-0.2/randomsound.c:283:16: [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((file = fopen(pidfile, "r")) != NULL) { data/randomsound-0.2/randomsound.c:293:16: [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((file = fopen(pidfile, "w")) == NULL) { data/randomsound-0.2/asoundrunner.c:78:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int readbytes = read(arecord_read_fd, buffer, SAMPLERATE*5); ANALYSIS SUMMARY: Hits = 11 Lines analyzed = 713 in approximately 0.03 seconds (26252 lines/second) Physical Source Lines of Code (SLOC) = 533 Hits@level = [0] 30 [1] 1 [2] 8 [3] 1 [4] 1 [5] 0 Hits@level+ = [0+] 41 [1+] 11 [2+] 10 [3+] 2 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 76.9231 [1+] 20.6379 [2+] 18.7617 [3+] 3.75235 [4+] 1.87617 [5+] 0 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.