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/muroar-0.1.13/muroar.c Examining data/muroar-0.1.13/muroar.h Examining data/muroar-0.1.13/muroar_beep.c Examining data/muroar-0.1.13/muroar_close.c Examining data/muroar-0.1.13/muroar_noop.c Examining data/muroar-0.1.13/muroar_quit.c Examining data/muroar-0.1.13/muroar_setvolume.c Examining data/muroar-0.1.13/muroar_stream.c Examining data/muroar-0.1.13/muroario.c Examining data/muroar-0.1.13/muroarstream.c Examining data/muroar-0.1.13/private.h FINAL RESULTS: data/muroar-0.1.13/muroar.c:267:15: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. if ( (len = readlink("/etc/roarserver", useraddr, sizeof(useraddr))) != -1 ) { data/muroar-0.1.13/muroar.c:352:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy((char*)&(buf[5]), name); data/muroar-0.1.13/muroar.c:263:12: [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. server = getenv("ROAR_SERVER"); data/muroar-0.1.13/muroar.c:296:10: [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. home = getenv("HOME"); data/muroar-0.1.13/muroar.c:93: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 localnode[16] = {0}; data/muroar-0.1.13/muroar.c:194: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((struct in_addr *)&(in.sin_addr), he->h_addr, sizeof(struct in_addr)); data/muroar-0.1.13/muroar.c:198:25: [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). in.sin_port = htons(atoi(object)); data/muroar-0.1.13/muroar.c:246: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 useraddr[80] = MUROAR_INVALID; data/muroar-0.1.13/muroar.c:249: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 buf[MUROAR_IOBUF]; data/muroar-0.1.13/muroar_noop.c:34: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 msg[10] = "\0\0\0\0\0\0\0\0\0\0"; data/muroar-0.1.13/muroar_setvolume.c:29: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 buf[20]; data/muroar-0.1.13/muroar_setvolume.c:30: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 ans[10]; data/muroar-0.1.13/muroar_stream.c:30: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 buf[24]; data/muroar-0.1.13/muroarstream.c:46:9: [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). return atoi(chans); data/muroar-0.1.13/muroarstream.c:68:9: [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). return atoi(codec); data/muroar-0.1.13/muroarstream.c:91: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[1024]; data/muroar-0.1.13/muroarstream.c:150:11: [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). rate = atoi(argv[++i]); data/muroar-0.1.13/muroarstream.c:156:11: [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). bits = atoi(argv[++i]); data/muroar-0.1.13/muroarstream.c:195: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). filefh = open(file, O_LARGEFILE|(tx ? O_RDONLY : O_WRONLY|O_CREAT|O_TRUNC), 0666); data/muroar-0.1.13/muroar.c:114:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(un.sun_path + 1, "RoarAudio/UNIX/Abstract/1", sizeof(un.sun_path) - 2); data/muroar-0.1.13/muroar.c:116:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(un.sun_path, server, sizeof(un.sun_path) - 1); data/muroar-0.1.13/muroar.c:151:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(localnode, dp->n_name, sizeof(localnode)-1); data/muroar-0.1.13/muroar.c:297:42: [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 ( home != NULL && home[0] == '/' && strlen(home) < (sizeof(useraddr) - 7) ) { data/muroar-0.1.13/muroar.c:326:11: [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). tmpu16 = strlen(name) + 5; data/muroar-0.1.13/muroarstream.c:98:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((len = read(file, buf, sizeof(buf))) > 0) ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 1457 in approximately 0.07 seconds (20606 lines/second) Physical Source Lines of Code (SLOC) = 887 Hits@level = [0] 14 [1] 6 [2] 15 [3] 2 [4] 1 [5] 1 Hits@level+ = [0+] 39 [1+] 25 [2+] 19 [3+] 4 [4+] 2 [5+] 1 Hits/KSLOC@level+ = [0+] 43.9684 [1+] 28.1849 [2+] 21.4205 [3+] 4.50958 [4+] 2.25479 [5+] 1.1274 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.