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/aumix-2.9.1/src/interactive.c Examining data/aumix-2.9.1/src/mouse.h Examining data/aumix-2.9.1/src/gpm-xterm.h Examining data/aumix-2.9.1/src/mouse.c Examining data/aumix-2.9.1/src/gtk.c Examining data/aumix-2.9.1/src/dummy.c Examining data/aumix-2.9.1/src/gpm-xterm.c Examining data/aumix-2.9.1/src/common.c Examining data/aumix-2.9.1/src/common.h Examining data/aumix-2.9.1/src/curses.h Examining data/aumix-2.9.1/src/gtk.h Examining data/aumix-2.9.1/src/interactive.h Examining data/aumix-2.9.1/src/curses.c FINAL RESULTS: data/aumix-2.9.1/src/common.c:134:6: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(device_filename, F_OK) != 0) data/aumix-2.9.1/src/common.c:311:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(string, LOCAL_TEXT("aumix: unknown error %i"), error); data/aumix-2.9.1/src/common.c:339:5: [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(LOCAL_TEXT("%i ms wait\n"), left); data/aumix-2.9.1/src/common.c:635:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s/.%s", home, AUMIXRC); data/aumix-2.9.1/src/common.c:640:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s/%s", AUMIXRC_PATH, AUMIXRC); data/aumix-2.9.1/src/common.c:716:2: [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. fprintf(fp, LOCAL_TEXT("aumix %s usage: aumix [-<channel option>[[+|-][<amount>]]|<level>|\nR[ecord]|P[lay]|q[uery]]"), VERSION); data/aumix-2.9.1/src/common.c:718:2: [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. fprintf(fp, LOCAL_TEXT(" [-dhILqS]")); data/aumix-2.9.1/src/common.c:720:2: [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. fprintf(fp, LOCAL_TEXT(" [-dhLqS]")); data/aumix-2.9.1/src/common.c:723:2: [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. fprintf(fp, LOCAL_TEXT(" [-C <color scheme file>]")); data/aumix-2.9.1/src/common.c:725:2: [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. fprintf(fp, LOCAL_TEXT(" [-f <rc file>]")); data/aumix-2.9.1/src/common.c:727:2: [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. fprintf(fp, LOCAL_TEXT("\ data/aumix-2.9.1/src/common.c:740:2: [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. fprintf(fp, LOCAL_TEXT("\ data/aumix-2.9.1/src/common.c:743:2: [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. fprintf(fp, LOCAL_TEXT("\ data/aumix-2.9.1/src/common.c:749:2: [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. fprintf(fp, LOCAL_TEXT("\ data/aumix-2.9.1/src/common.c:752:2: [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. fprintf(fp, LOCAL_TEXT("\ data/aumix-2.9.1/src/curses.c:285:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s", scheme); data/aumix-2.9.1/src/curses.c:288:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s/%s", DATADIR, scheme); data/aumix-2.9.1/src/common.c:145:10: [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. optn = getopt(argc, argv, "hILqSd:f:C::v:b:t:s:w:P:p:l:m:c:x:W:R:r:i:o:1:2:3:"); data/aumix-2.9.1/src/common.c:147:10: [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. optn = getopt(argc, argv, "hILqSd:f:C:v:b:t:s:w:P:p:l:m:c:x:W:R:r:i:o:1:2:3:"); data/aumix-2.9.1/src/common.c:236:22: [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. if ((env_display = getenv("DISPLAY")) && (*env_display != '\0')) data/aumix-2.9.1/src/common.c:633: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/aumix-2.9.1/src/curses.c:57:24: [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. if ((lang = (char *) getenv("LANG")) && !strncmp(lang, LANGUAGES[ii], 5)) { data/aumix-2.9.1/src/curses.c:64:24: [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. if ((lang = (char *) getenv("LANG")) && !strncmp(lang, LANGUAGES[ii], 5)) { data/aumix-2.9.1/src/curses.c:254:11: [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. if ((s = getenv("TERM")) && !strncmp(s, "xterm", 5)) data/aumix-2.9.1/src/curses.c:255: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. if ((s = getenv("DISPLAY")) == NULL) data/aumix-2.9.1/src/gpm-xterm.c:127:22: [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. if ((tty = (char *) getenv("TERM")) && !strncmp(tty, "xterm", 5)) { data/aumix-2.9.1/src/common.c:76: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 *dev_label[SOUND_MIXER_NRDEVICES] = data/aumix-2.9.1/src/common.c:105: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 *dev_label[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_LABELS; data/aumix-2.9.1/src/common.c:107: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 *dev_name[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES; data/aumix-2.9.1/src/common.c:257:19: [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 ((mixer_fd = open(device_filename, O_RDWR)) < 0) data/aumix-2.9.1/src/common.c:298: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 string[80]; data/aumix-2.9.1/src/common.c:330: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 textline[80], tmpstring[80], recplay; data/aumix-2.9.1/src/common.c:418:18: [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 ((mixer_fd = open(device_filename, O_RDWR)) < 0) data/aumix-2.9.1/src/common.c:610:9: [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). return fopen(filename, mode); data/aumix-2.9.1/src/common.c:631: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 filename[PATH_MAX]; data/aumix-2.9.1/src/common.c:656: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 dest[4]; data/aumix-2.9.1/src/common.c:666:7: [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). if (atoi(dest)) data/aumix-2.9.1/src/common.c:667: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). change = atoi(dest); data/aumix-2.9.1/src/common.c:700: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). tmp = atoi(optarg); data/aumix-2.9.1/src/common.h:114: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. extern char *dev_label[SOUND_MIXER_NRDEVICES]; data/aumix-2.9.1/src/curses.c:54: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 hotkey[2] = ""; data/aumix-2.9.1/src/curses.c:103:24: [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. mvaddstr(ii + 2, 0, (char *) LOCAL_TEXT(menuitems[ii])); data/aumix-2.9.1/src/curses.c:106:20: [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. strncpy(hotkey, (char *) LOCAL_TEXT(menuitems[ii]), 1); data/aumix-2.9.1/src/curses.c:276: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 filename[PATH_MAX], *item, *fore, *back; data/aumix-2.9.1/src/curses.c:277: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[BUFSIZ], *p; data/aumix-2.9.1/src/curses.c:286:15: [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). schemefile = fopen(filename, "r"); data/aumix-2.9.1/src/curses.c:289: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). schemefile = fopen(filename, "r"); data/aumix-2.9.1/src/gpm-xterm.c:54:18: [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 mdata[4]; data/aumix-2.9.1/src/gpm-xterm.c:157:18: [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 mdata[4]; data/aumix-2.9.1/src/gtk.c:213: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 *fileacceltext[5] = {LOCAL_TEXT_NOOP("l"), LOCAL_TEXT_NOOP("s"), LOCAL_TEXT_NOOP("f"), LOCAL_TEXT_NOOP("t"), LOCAL_TEXT_NOOP("q")}; data/aumix-2.9.1/src/common.c:340:4: [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(left * 1000); data/aumix-2.9.1/src/common.c:634:17: [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 && ((strlen(home) + strlen(AUMIXRC) + 2) < PATH_MAX)) { data/aumix-2.9.1/src/common.c:634:32: [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 && ((strlen(home) + strlen(AUMIXRC) + 2) < PATH_MAX)) { data/aumix-2.9.1/src/common.c:639:9: [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(AUMIXRC_PATH) + strlen(AUMIXRC) + 1) < PATH_MAX) { data/aumix-2.9.1/src/common.c:639:32: [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(AUMIXRC_PATH) + strlen(AUMIXRC) + 1) < PATH_MAX) { data/aumix-2.9.1/src/common.c:664:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dest, (optarg + 1), 3); data/aumix-2.9.1/src/curses.c:106:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(hotkey, (char *) LOCAL_TEXT(menuitems[ii]), 1); data/aumix-2.9.1/src/curses.c:115:75: [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). mvaddstr(YOFFSET + y, XOFFSET + menu_width + R_P_WIDTH + (level_width - strlen(LOCAL_TEXT("Level"))) / 2, (char *) LOCAL_TEXT("Level")); data/aumix-2.9.1/src/curses.c:118:123: [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). mvaddstr(YOFFSET + y, XOFFSET + menu_width + R_P_WIDTH + level_width + label_width + ARROW_WIDTH * 2 + (balance_width - strlen(LOCAL_TEXT("Balance"))) / 2, (char *) LOCAL_TEXT("Balance")); data/aumix-2.9.1/src/curses.c:283:7: [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(scheme) + strlen(DATADIR) + 1) >= PATH_MAX) data/aumix-2.9.1/src/curses.c:283:24: [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(scheme) + strlen(DATADIR) + 1) >= PATH_MAX) data/aumix-2.9.1/src/gpm-xterm.c:164:10: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return fgetc(f); data/aumix-2.9.1/src/gpm-xterm.c:184:12: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = fgetc(f)) != 0x1b) data/aumix-2.9.1/src/gpm-xterm.c:193:12: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = fgetc(f)) != '[') data/aumix-2.9.1/src/gpm-xterm.c:212:12: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = fgetc(f)) != 'M') data/aumix-2.9.1/src/gpm-xterm.c:221:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). mdata[c] = fgetc(f); ANALYSIS SUMMARY: Hits = 66 Lines analyzed = 3359 in approximately 0.15 seconds (22743 lines/second) Physical Source Lines of Code (SLOC) = 2577 Hits@level = [0] 16 [1] 16 [2] 24 [3] 9 [4] 17 [5] 0 Hits@level+ = [0+] 82 [1+] 66 [2+] 50 [3+] 26 [4+] 17 [5+] 0 Hits/KSLOC@level+ = [0+] 31.8199 [1+] 25.6112 [2+] 19.4024 [3+] 10.0893 [4+] 6.59682 [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.