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/xdemorse-3.6.2/src/interface.h Examining data/xdemorse-3.6.2/src/filters.h Examining data/xdemorse-3.6.2/src/utils.c Examining data/xdemorse-3.6.2/src/interface.c Examining data/xdemorse-3.6.2/src/display.h Examining data/xdemorse-3.6.2/src/sound.c Examining data/xdemorse-3.6.2/src/shared.c Examining data/xdemorse-3.6.2/src/decode.h Examining data/xdemorse-3.6.2/src/shared.h Examining data/xdemorse-3.6.2/src/callbacks.c Examining data/xdemorse-3.6.2/src/common.h Examining data/xdemorse-3.6.2/src/detect.c Examining data/xdemorse-3.6.2/src/ifft.h Examining data/xdemorse-3.6.2/src/perseus.c Examining data/xdemorse-3.6.2/src/filters.c Examining data/xdemorse-3.6.2/src/detect.h Examining data/xdemorse-3.6.2/src/perseus.h Examining data/xdemorse-3.6.2/src/sound.h Examining data/xdemorse-3.6.2/src/ifft.c Examining data/xdemorse-3.6.2/src/decode.c Examining data/xdemorse-3.6.2/src/callbacks.h Examining data/xdemorse-3.6.2/src/utils.h Examining data/xdemorse-3.6.2/src/main.h Examining data/xdemorse-3.6.2/src/display.c Examining data/xdemorse-3.6.2/src/cat.h Examining data/xdemorse-3.6.2/src/cat.c Examining data/xdemorse-3.6.2/src/main.c FINAL RESULTS: data/xdemorse-3.6.2/src/main.c:50:20: [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( (option = getopt(argc, argv, "hv") ) != -1 ) data/xdemorse-3.6.2/src/utils.c:351:31: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. "%s/.xdemorse/xdemorserc", getenv("HOME") ); data/xdemorse-3.6.2/src/callbacks.c:273: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 mesg[MESG_SIZE]; data/xdemorse-3.6.2/src/cat.c:171:3: [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 frq[5]; data/xdemorse-3.6.2/src/cat.c:210:10: [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). *freq = atoi( K3_VFOA_S + 2 ); data/xdemorse-3.6.2/src/cat.c:229:3: [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 freq_buff[11]; data/xdemorse-3.6.2/src/cat.c:283:3: [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 test[5]; data/xdemorse-3.6.2/src/cat.c:289: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). serial_fd = open( rc_data.cat_serial, O_RDWR | O_NOCTTY ); data/xdemorse-3.6.2/src/cat.c:292: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 mesg[MESG_SIZE]; data/xdemorse-3.6.2/src/cat.c:313: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 mesg[MESG_SIZE]; data/xdemorse-3.6.2/src/common.h:65:3: [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 data/xdemorse-3.6.2/src/common.h:78:3: [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 cat_serial[32]; data/xdemorse-3.6.2/src/common.h:101:3: [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 xdemorse_glade[64]; data/xdemorse-3.6.2/src/decode.c:80: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. static char * data/xdemorse-3.6.2/src/decode.c:84:19: [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 data/xdemorse-3.6.2/src/display.c:273:3: [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 dec_char[MAX_CHAR_LEN]; data/xdemorse-3.6.2/src/perseus.c:33:3: [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 txt[MESG_SIZE]; data/xdemorse-3.6.2/src/perseus.c:473:3: [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 txt[MESG_SIZE]; data/xdemorse-3.6.2/src/sound.c:336: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 mesg[MESG_SIZE]; data/xdemorse-3.6.2/src/sound.c:353:3: [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 mesg[MESG_SIZE]; data/xdemorse-3.6.2/src/sound.c:390: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 mesg[MESG_SIZE]; data/xdemorse-3.6.2/src/utils.c:215:3: [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 error_mesg[MESG_SIZE]; data/xdemorse-3.6.2/src/utils.c:317:3: [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 data/xdemorse-3.6.2/src/utils.c:354: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). xdemorserc = fopen( rc_fpath, "r" ); data/xdemorse-3.6.2/src/utils.c:376: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). rc_data.dsp_rate = atoi( line ); data/xdemorse-3.6.2/src/utils.c:413: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). rc_data.cap_level = atoi( line ); data/xdemorse-3.6.2/src/utils.c:418: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). rc_data.min_unit = atoi( line ); data/xdemorse-3.6.2/src/utils.c:423: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). rc_data.max_unit = atoi( line ); data/xdemorse-3.6.2/src/utils.c:445:13: [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). int wpm = atoi( line ); data/xdemorse-3.6.2/src/utils.c:515: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). rc_data.tone_freq = atoi( line ); data/xdemorse-3.6.2/src/cat.c:81:2: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep( 100000 ); data/xdemorse-3.6.2/src/cat.c:97:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t ret = (size_t)read( serial_fd, data, len ); data/xdemorse-3.6.2/src/cat.c:139:2: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep( 100000 ); data/xdemorse-3.6.2/src/cat.c:154:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep( 50000 ); data/xdemorse-3.6.2/src/display.c:281:6: [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). if( strlen(dec_char) == 0 ) return( TRUE ); data/xdemorse-3.6.2/src/utils.c:227:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if( (chr = fgetc(pfile)) == EOF ) data/xdemorse-3.6.2/src/utils.c:246:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if( (chr = fgetc(pfile)) == EOF ) data/xdemorse-3.6.2/src/utils.c:257:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if( (chr = fgetc(pfile)) == EOF ) data/xdemorse-3.6.2/src/utils.c:278:13: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if( (chr = fgetc(pfile)) == EOF ) ANALYSIS SUMMARY: Hits = 39 Lines analyzed = 5422 in approximately 0.17 seconds (32847 lines/second) Physical Source Lines of Code (SLOC) = 3296 Hits@level = [0] 56 [1] 9 [2] 28 [3] 2 [4] 0 [5] 0 Hits@level+ = [0+] 95 [1+] 39 [2+] 30 [3+] 2 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 28.8228 [1+] 11.8325 [2+] 9.10194 [3+] 0.606796 [4+] 0 [5+] 0 Dot directories skipped = 2 (--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.