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/morse-2.5/morse.d/alarm.h Examining data/morse-2.5/morse.d/beepALSA.c Examining data/morse-2.5/morse.d/beep.h Examining data/morse-2.5/morse.d/beepLinux.c Examining data/morse-2.5/morse.d/beepOSS.c Examining data/morse-2.5/morse.d/beepX11.c Examining data/morse-2.5/morse.d/alarm.c Examining data/morse-2.5/morse.d/beepPA.c Examining data/morse-2.5/morse.d/morse.c Examining data/morse-2.5/qso.d/antenna.h Examining data/morse-2.5/qso.d/callsign.h Examining data/morse-2.5/qso.d/city.h Examining data/morse-2.5/qso.d/cityh.h Examining data/morse-2.5/qso.d/grammar.c Examining data/morse-2.5/qso.d/heights.h Examining data/morse-2.5/qso.d/init_str.c Examining data/morse-2.5/qso.d/jobs.h Examining data/morse-2.5/qso.d/make_fre.c Examining data/morse-2.5/qso.d/misc.h Examining data/morse-2.5/qso.d/names.h Examining data/morse-2.5/qso.d/newcity.h Examining data/morse-2.5/qso.d/put_form.c Examining data/morse-2.5/qso.d/QSO.c Examining data/morse-2.5/qso.d/rig.h Examining data/morse-2.5/qso.d/util.c Examining data/morse-2.5/qso.d/weather.h FINAL RESULTS: data/morse-2.5/morse.d/beepPA.c:24:26: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define dprintf(args...) printf(args) data/morse-2.5/qso.d/QSO.c:680:4: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf (Frqmisc[Roll (NFRQMISC)], make_freq ()); data/morse-2.5/qso.d/QSO.c:685:4: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf (Callmisc[Roll (NFRQMISC)], data/morse-2.5/qso.d/QSO.c:691:4: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf (FrqCallmisc[Roll (NFRQCALLMISC)], data/morse-2.5/qso.d/QSO.c:698:4: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf (NumMisc[Roll (NNUMMISC)], data/morse-2.5/qso.d/grammar.c:30:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buffer, "an %s", string); data/morse-2.5/qso.d/grammar.c:32:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buffer, "a %s", string); data/morse-2.5/morse.d/morse.c:348:18: [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, "ABC:E:F:IM:N:R:STX:abcdef:g:ilmn:p:qrstv:w:x:")) != EOF) data/morse-2.5/morse.d/morse.c:720:11: [3] (random) lrand48: 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. (((lrand48() >> 9) + (long) (time (NULL))) >> 4) data/morse-2.5/morse.d/morse.c:1859:14: [3] (random) lrand48: 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. ranspot = ((lrand48() >> 4) % sum + norepeat) % sum; data/morse-2.5/qso.d/util.c:33:8: [3] (random) drand48: 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. double drand48 (); data/morse-2.5/qso.d/util.c:34:23: [3] (random) drand48: 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. tmp_val = ((int) (drand48 () * (Number /*-1*/ ))); data/morse-2.5/morse.d/beepLinux.c:36:13: [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). if ((fd = open("/dev/console",O_WRONLY)) == -1) data/morse-2.5/morse.d/beepOSS.c:24:17: [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. static unsigned char silence[2*MAXTIME]; data/morse-2.5/morse.d/beepOSS.c:25:17: [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. static unsigned char soundbuf[2*(MAXTIME - RAMP)]; data/morse-2.5/morse.d/beepOSS.c:26:17: [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. static unsigned char ramp_down[2*RAMP]; data/morse-2.5/morse.d/beepOSS.c:38:11: [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). audio = open(DEVICE_NAME, O_WRONLY, 0); data/morse-2.5/morse.d/morse.c:121:8: [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. static char teststring[TESTBUFSZ]; data/morse-2.5/morse.d/morse.c:124:8: [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. static char yourstring[TESTBUFSZ]; data/morse-2.5/morse.d/morse.c:135:8: [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. static char *(code[TWOFIFTYSIX]); data/morse-2.5/morse.d/morse.c:362:24: [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). error_threshold = atoi (optarg); data/morse-2.5/morse.d/morse.c:374:23: [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). max_behindness = atoi (optarg); data/morse-2.5/morse.d/morse.c:379:18: [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). wordcount = atoi(optarg); data/morse-2.5/morse.d/morse.c:383: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). timeout = atoi (optarg); data/morse-2.5/morse.d/morse.c:428: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). wordlen = atoi (optarg); data/morse-2.5/morse.d/morse.c:435: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). tryagaincount = atoi (optarg); data/morse-2.5/morse.d/morse.c:849:8: [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. static char word[MAXWORDLEN+1]; data/morse-2.5/morse.d/morse.c:1746: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). termfd = open (terminal, O_RDWR | O_NDELAY, 0); data/morse-2.5/morse.d/morse.c:1762:8: [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. static char line[TESTBUFSZ]; data/morse-2.5/morse.d/morse.c:1930:10: [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. qsort ((char *) randomstr, count, sizeof (randomstr[0]), rancomp); data/morse-2.5/qso.d/grammar.c:23:1: [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 buffer[200]; data/morse-2.5/morse.d/morse.c:579:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (ii = 0; ii < strlen(user_charset); ii++) data/morse-2.5/morse.d/morse.c:613:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). randomfactor[ii] = RANDOMBASELEVEL - strlen (code[ii]); data/morse-2.5/morse.d/morse.c:757:19: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ch = getchar ()) != EOF) data/morse-2.5/morse.d/morse.c:1765:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read (termfd, line, sizeof (line) - 1); ANALYSIS SUMMARY: Hits = 35 Lines analyzed = 5196 in approximately 0.13 seconds (39027 lines/second) Physical Source Lines of Code (SLOC) = 4037 Hits@level = [0] 237 [1] 4 [2] 19 [3] 5 [4] 7 [5] 0 Hits@level+ = [0+] 272 [1+] 35 [2+] 31 [3+] 12 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 67.3768 [1+] 8.6698 [2+] 7.67897 [3+] 2.9725 [4+] 1.73396 [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.