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/mednaffe-0.8.8/src/about.c Examining data/mednaffe-0.8.8/src/active.c Examining data/mednaffe-0.8.8/src/command.c Examining data/mednaffe-0.8.8/src/common.h Examining data/mednaffe-0.8.8/src/gui.c Examining data/mednaffe-0.8.8/src/input.c Examining data/mednaffe-0.8.8/src/input.h Examining data/mednaffe-0.8.8/src/joystick_linux.c Examining data/mednaffe-0.8.8/src/joystick_linux.h Examining data/mednaffe-0.8.8/src/joystick_win.c Examining data/mednaffe-0.8.8/src/joystick_win.h Examining data/mednaffe-0.8.8/src/list.c Examining data/mednaffe-0.8.8/src/log.c Examining data/mednaffe-0.8.8/src/log.h Examining data/mednaffe-0.8.8/src/logo.h Examining data/mednaffe-0.8.8/src/mednaffe.c Examining data/mednaffe-0.8.8/src/mednaffe_glade.h Examining data/mednaffe-0.8.8/src/prefs.c Examining data/mednaffe-0.8.8/src/prefs.h Examining data/mednaffe-0.8.8/src/resource.c Examining data/mednaffe-0.8.8/src/resource.h Examining data/mednaffe-0.8.8/src/settings_glade.h Examining data/mednaffe-0.8.8/src/system_glade.h Examining data/mednaffe-0.8.8/src/toggles.c Examining data/mednaffe-0.8.8/src/toggles.h FINAL RESULTS: data/mednaffe-0.8.8/src/common.h:91:11: [4] (shell) system: 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. gchar *system; data/mednaffe-0.8.8/src/input.c:274:38: [4] (shell) system: 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. fullcommand = g_strconcat(gui->system,".input.",gui->port, command, NULL); data/mednaffe-0.8.8/src/input.c:334:64: [4] (shell) system: 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. gui->specific, gui->system)); data/mednaffe-0.8.8/src/input.c:350:36: [4] (shell) system: 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. command = g_strconcat(gui->system, ".input.", data/mednaffe-0.8.8/src/input.c:955:36: [4] (shell) system: 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. fullcommand = g_strconcat(gui->system,".input.",gui->port, command, NULL); data/mednaffe-0.8.8/src/input.c:1034:38: [4] (shell) system: 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. fullcommand = g_strconcat(gui->system,".input.",gui->port, command, NULL); data/mednaffe-0.8.8/src/mednaffe.c:140:14: [4] (shell) system: 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. if (gui->system) data/mednaffe-0.8.8/src/mednaffe.c:143:34: [4] (shell) system: 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. astring = g_strconcat(gui->system, "inputbox", NULL); data/mednaffe-0.8.8/src/mednaffe.c:153:64: [4] (shell) system: 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. (const char *)gui->system)); data/mednaffe-0.8.8/src/mednaffe.c:157:19: [4] (shell) system: 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. g_free(gui->system); data/mednaffe-0.8.8/src/mednaffe.c:161:47: [4] (shell) system: 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. 1, &gui->system, data/mednaffe-0.8.8/src/mednaffe.c:180:64: [4] (shell) system: 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. (const char *)gui->system)); data/mednaffe-0.8.8/src/mednaffe.c:183:32: [4] (shell) system: 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. astring = g_strconcat(gui->system, "inputbox", NULL); data/mednaffe-0.8.8/src/mednaffe.c:297:15: [4] (shell) system: 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. g_free(gui->system); data/mednaffe-0.8.8/src/mednaffe.c:533:5: [4] (shell) system: 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. system(qbin); data/mednaffe-0.8.8/src/toggles.c:63:33: [4] (shell) system: 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. fullname = g_strconcat(gui->system, name, NULL); data/mednaffe-0.8.8/src/toggles.c:168:33: [4] (shell) system: 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. fullname = g_strconcat(gui->system, name, NULL); data/mednaffe-0.8.8/src/toggles.c:194:33: [4] (shell) system: 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. fullname = g_strconcat(gui->system, name, NULL); data/mednaffe-0.8.8/src/toggles.c:231:33: [4] (shell) system: 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. fullname = g_strconcat(gui->system, name, NULL); data/mednaffe-0.8.8/src/command.c:256:9: [3] (shell) CreateProcess: This causes a new process to execute and is difficult to use safely (CWE-78). Specify the application path in the first argument, NOT as part of the second, or embedded spaces could allow an attacker to force a different program to run. ret = CreateProcess(NULL, gui->command, NULL, NULL, FALSE, 0, data/mednaffe-0.8.8/src/command.c:256:9: [3] (shell) CreateProcess: This causes a new process to execute and is difficult to use safely (CWE-78). Specify the application path in the first argument, NOT as part of the second, or embedded spaces could allow an attacker to force a different program to run. ret = CreateProcess(NULL, gui->command, NULL, NULL, FALSE, 0, data/mednaffe-0.8.8/src/joystick_linux.c:86:14: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if(!(tmp = realpath(buf, NULL))) data/mednaffe-0.8.8/src/mednaffe.c:519:12: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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 = g_get_home_dir(); data/mednaffe-0.8.8/src/about.c:30: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. const char *authors[2] = {"AmatCoder", NULL}; data/mednaffe-0.8.8/src/input.c:804: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. char pszGUID[32]; data/mednaffe-0.8.8/src/joystick_linux.c: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 buf[256]; data/mednaffe-0.8.8/src/joystick_linux.c:129: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). FILE *fp = fopen(idpath, "r"); data/mednaffe-0.8.8/src/joystick_linux.c:174:23: [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). gui->joy[js].js_fd = open(path, O_RDONLY); data/mednaffe-0.8.8/src/prefs.c:153:10: [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). file = fopen(conf_file, "w"); data/mednaffe-0.8.8/src/input.c:221:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t s = read (fd, &e, sizeof(e)); data/mednaffe-0.8.8/src/resource.c:1341:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __pragma(section(".CRT$XCU",read)) \ data/mednaffe-0.8.8/src/resource.c:1347:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __pragma(section(".CRT$XCU",read)) \ data/mednaffe-0.8.8/src/resource.c:1359:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). section(".CRT$XCU",read) data/mednaffe-0.8.8/src/resource.c:1366:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). section(".CRT$XCU",read) data/mednaffe-0.8.8/src/toggles.c:380: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(stout)<1) return FALSE; data/mednaffe-0.8.8/src/toggles.c:389: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(aline[1])<4) return FALSE; ANALYSIS SUMMARY: Hits = 36 Lines analyzed = 21259 in approximately 0.87 seconds (24471 lines/second) Physical Source Lines of Code (SLOC) = 19886 Hits@level = [0] 16 [1] 7 [2] 6 [3] 4 [4] 19 [5] 0 Hits@level+ = [0+] 52 [1+] 36 [2+] 29 [3+] 23 [4+] 19 [5+] 0 Hits/KSLOC@level+ = [0+] 2.6149 [1+] 1.81032 [2+] 1.45831 [3+] 1.15659 [4+] 0.955446 [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.