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/multimon-1.0/filter.h Examining data/multimon-1.0/costabf.c Examining data/multimon-1.0/demod_afsk12.c Examining data/multimon-1.0/demod_afsk24.c Examining data/multimon-1.0/demod_afsk24_2.c Examining data/multimon-1.0/demod_hapn48.c Examining data/multimon-1.0/demod_fsk96.c Examining data/multimon-1.0/demod_poc5.c Examining data/multimon-1.0/demod_poc12.c Examining data/multimon-1.0/demod_poc24.c Examining data/multimon-1.0/demod_dtmf.c Examining data/multimon-1.0/demod_zvei.c Examining data/multimon-1.0/demod_display.c Examining data/multimon-1.0/hdlc.c Examining data/multimon-1.0/pocsag.c Examining data/multimon-1.0/gen_dtmf.c Examining data/multimon-1.0/gen_sin.c Examining data/multimon-1.0/gen_zvei.c Examining data/multimon-1.0/gen_hdlc.c Examining data/multimon-1.0/costabi.c Examining data/multimon-1.0/mkcostab.c Examining data/multimon-1.0/xdisplay.c Examining data/multimon-1.0/filter-i386.h Examining data/multimon-1.0/demod_eas.c Examining data/multimon-1.0/unixinput.c Examining data/multimon-1.0/demod_ccir.c Examining data/multimon-1.0/gen.c Examining data/multimon-1.0/gen_ccir.c Examining data/multimon-1.0/gen.h Examining data/multimon-1.0/multimon.h FINAL RESULTS: data/multimon-1.0/gen.c:50:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. int snprintf(char *buf, size_t sz, const char *fmt, ...) data/multimon-1.0/gen.c:56:6: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. i = vsprintf(buf, fmt, arg); data/multimon-1.0/gen.c:322:4: [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("sox", "sox", data/multimon-1.0/gen.c:506:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, usage_str); data/multimon-1.0/unixinput.c:77:17: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stdout, fmt, args); data/multimon-1.0/unixinput.c:339:4: [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("sox", "sox", data/multimon-1.0/unixinput.c:475:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, usage_str); data/multimon-1.0/xdisplay.c:96:11: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)fprintf(stderr, mesg, evt->request_code); data/multimon-1.0/gen.c:380:14: [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 ((c = getopt(argc, argv, "t:a:d:s:z:c:p:")) != EOF) { data/multimon-1.0/unixinput.c:403:14: [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 ((c = getopt(argc, argv, "t:a:s:v:q")) != EOF) { data/multimon-1.0/demod_display.c:73:2: [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(dst, src, i*sizeof(s->l1.scope.data[0])); data/multimon-1.0/gen.c:123:12: [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(ifname ? ifname : "/dev/audio", O_WRONLY)) < 0) { data/multimon-1.0/gen.c:181:12: [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. unsigned char b[8192]; data/multimon-1.0/gen.c:188:12: [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(ifname ? ifname : "/dev/dsp", O_WRONLY)) < 0) { data/multimon-1.0/gen.c:297: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(fname, O_WRONLY|O_CREAT|O_EXCL, 0777)) < 0) { data/multimon-1.0/gen.c:311:4: [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 srate[8]; data/multimon-1.0/gen.h:40:4: [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 str[256]; data/multimon-1.0/gen.h:49:4: [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 str[256]; data/multimon-1.0/gen.h:54:4: [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 str[256]; data/multimon-1.0/gen.h:60:13: [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. unsigned char pkt[256]; data/multimon-1.0/gen.h:91:13: [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. unsigned char data[512]; data/multimon-1.0/mkcostab.c:40: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). if (!(fi = fopen("costabi.c", "w"))) data/multimon-1.0/mkcostab.c:42: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). if (!(ff = fopen("costabf.c", "w"))) data/multimon-1.0/multimon.h:41:13: [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. unsigned char rxbuf[512]; data/multimon-1.0/multimon.h:56:14: [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. unsigned char buffer[128]; data/multimon-1.0/pocsag.c:118: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 buf[256], *cp = buf; data/multimon-1.0/pocsag.c:220: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 buf[256], *cp = buf; data/multimon-1.0/pocsag.c:248:5: [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(cp, tstr, tlen); data/multimon-1.0/pocsag.c:269: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 buf[256], *cp = buf; data/multimon-1.0/pocsag.c:297:5: [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(cp, tstr, tlen); data/multimon-1.0/unixinput.c:111:12: [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(ifname ? ifname : "/dev/audio", O_RDONLY)) < 0) { data/multimon-1.0/unixinput.c:175:12: [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. unsigned char b[8192]; data/multimon-1.0/unixinput.c:185:12: [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(ifname ? ifname : "/dev/dsp", O_RDONLY)) < 0) { data/multimon-1.0/unixinput.c:314: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(fname, O_RDONLY)) < 0) { data/multimon-1.0/unixinput.c:328:4: [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 srate[8]; data/multimon-1.0/unixinput.c:333:4: [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(srate, "%d", sample_rate); data/multimon-1.0/xdisplay.c:48:11: [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. unsigned char b[0]; data/multimon-1.0/xdisplay.c:89: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 err_buf[256], mesg[256], number[256]; data/multimon-1.0/xdisplay.c:97:11: [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. (void)sprintf(number, "%d", evt->request_code); data/multimon-1.0/xdisplay.c:118:9: [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 kbuf[32]; data/multimon-1.0/gen.c:427:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(params[num_gen-1].p.dtmf.str, optarg, sizeof(params[num_gen-1].p.dtmf.str)); data/multimon-1.0/gen.c:454:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(params[num_gen-1].p.zvei.str, optarg, sizeof(params[num_gen-1].p.dtmf.str)); data/multimon-1.0/gen.c:468:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(params[num_gen-1].p.ccir.str, optarg, sizeof(params[num_gen-1].p.dtmf.str)); data/multimon-1.0/gen.c:498:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(params[num_gen-1].p.hdlc.pkt+16, optarg, data/multimon-1.0/gen.c:501:5: [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). strlen(params[num_gen-1].p.hdlc.pkt+16); data/multimon-1.0/pocsag.c:246:15: [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). int tlen = strlen(tstr); data/multimon-1.0/pocsag.c:295:15: [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). int tlen = strlen(tstr); data/multimon-1.0/unixinput.c:143:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(fd, sp = buffer, sizeof(buffer)); data/multimon-1.0/unixinput.c:246:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(fd, bp = b.b, sizeof(b.b)); data/multimon-1.0/unixinput.c:265:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(fd, sp = b.s, sizeof(b.s)); data/multimon-1.0/unixinput.c:357:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(fd, sp = buffer, sizeof(buffer)); data/multimon-1.0/xdisplay.c:276:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(datapipe[0], bp, j); data/multimon-1.0/xdisplay.c:410:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(cli[cnum].cmdfd, &c, 1); ANALYSIS SUMMARY: Hits = 53 Lines analyzed = 5489 in approximately 0.19 seconds (29386 lines/second) Physical Source Lines of Code (SLOC) = 3935 Hits@level = [0] 62 [1] 13 [2] 30 [3] 2 [4] 8 [5] 0 Hits@level+ = [0+] 115 [1+] 53 [2+] 40 [3+] 10 [4+] 8 [5+] 0 Hits/KSLOC@level+ = [0+] 29.2249 [1+] 13.4689 [2+] 10.1652 [3+] 2.5413 [4+] 2.03304 [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.