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/mupen64plus-rsp-hle-2.5.9/src/alist.c Examining data/mupen64plus-rsp-hle-2.5.9/src/alist.h Examining data/mupen64plus-rsp-hle-2.5.9/src/alist_audio.c Examining data/mupen64plus-rsp-hle-2.5.9/src/alist_naudio.c Examining data/mupen64plus-rsp-hle-2.5.9/src/alist_nead.c Examining data/mupen64plus-rsp-hle-2.5.9/src/arithmetics.h Examining data/mupen64plus-rsp-hle-2.5.9/src/audio.c Examining data/mupen64plus-rsp-hle-2.5.9/src/audio.h Examining data/mupen64plus-rsp-hle-2.5.9/src/cicx105.c Examining data/mupen64plus-rsp-hle-2.5.9/src/common.h Examining data/mupen64plus-rsp-hle-2.5.9/src/hle.c Examining data/mupen64plus-rsp-hle-2.5.9/src/hle.h Examining data/mupen64plus-rsp-hle-2.5.9/src/hle_external.h Examining data/mupen64plus-rsp-hle-2.5.9/src/hle_internal.h Examining data/mupen64plus-rsp-hle-2.5.9/src/jpeg.c Examining data/mupen64plus-rsp-hle-2.5.9/src/memory.c Examining data/mupen64plus-rsp-hle-2.5.9/src/memory.h Examining data/mupen64plus-rsp-hle-2.5.9/src/mp3.c Examining data/mupen64plus-rsp-hle-2.5.9/src/musyx.c Examining data/mupen64plus-rsp-hle-2.5.9/src/osal_dynamiclib.h Examining data/mupen64plus-rsp-hle-2.5.9/src/osal_dynamiclib_unix.c Examining data/mupen64plus-rsp-hle-2.5.9/src/osal_dynamiclib_win32.c Examining data/mupen64plus-rsp-hle-2.5.9/src/plugin.c Examining data/mupen64plus-rsp-hle-2.5.9/src/re2.c Examining data/mupen64plus-rsp-hle-2.5.9/src/ucodes.h FINAL RESULTS: data/mupen64plus-rsp-hle-2.5.9/src/plugin.c:197:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(msgbuf, message, args); data/mupen64plus-rsp-hle-2.5.9/src/osal_dynamiclib_win32.c:35:19: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. *pLibHandle = LoadLibrary(pccLibraryPath); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:161: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(hle->alist_buffer + dmem, hle->dram + address, count); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:170: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(hle->dram + address, hle->alist_buffer + dmem, count); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:195: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(buffer, hle->alist_buffer + dmemi, 128); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:198:9: [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(hle->alist_buffer + dmemo, buffer, 128); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:214:13: [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(hle->alist_buffer + dmemo, hle->alist_buffer + dmemi, 0x20); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:285: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((uint8_t *)save_buffer, (hle->dram + address), sizeof(save_buffer)); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:357: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(hle->dram + address, (uint8_t *)save_buffer, sizeof(save_buffer)); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:385: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((uint8_t *)save_buffer, (hle->dram + address), 80); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:436: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(hle->dram + address, (uint8_t *)save_buffer, 80); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:461: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((uint8_t *)save_buffer, hle->dram + address, 80); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:509: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(hle->dram + address, (uint8_t *)save_buffer, 80); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:905: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(hle->dram + address, in2 - 8, 16); data/mupen64plus-rsp-hle-2.5.9/src/alist.c:906: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(hle->alist_buffer + dmem, outbuff, count); data/mupen64plus-rsp-hle-2.5.9/src/cicx105.c:44: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(hle->imem + 0x120, hle->dram + 0x1e8, 0x1f0); data/mupen64plus-rsp-hle-2.5.9/src/cicx105.c:48:9: [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, 8); data/mupen64plus-rsp-hle-2.5.9/src/hle.c:396: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 filename[256]; data/mupen64plus-rsp-hle-2.5.9/src/hle.c:401:5: [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(&filename[0], "task_%x.log", sum); data/mupen64plus-rsp-hle-2.5.9/src/hle.c:405:5: [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(&filename[0], "ucode_boot_%x.bin", sum); data/mupen64plus-rsp-hle-2.5.9/src/hle.c:410:9: [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(&filename[0], "ucode_%x.bin", sum); data/mupen64plus-rsp-hle-2.5.9/src/hle.c:416:9: [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(&filename[0], "ucode_data_%x.bin", sum); data/mupen64plus-rsp-hle-2.5.9/src/hle.c:422:9: [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(&filename[0], "data_%x.bin", sum); data/mupen64plus-rsp-hle-2.5.9/src/hle.c:429: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 filename[256]; data/mupen64plus-rsp-hle-2.5.9/src/hle.c:432:5: [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(&filename[0], "imem_%x.bin", sum); data/mupen64plus-rsp-hle-2.5.9/src/hle.c:435:5: [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(&filename[0], "dmem_%x.bin", sum); data/mupen64plus-rsp-hle-2.5.9/src/hle.c:445: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). f = fopen(filename, "r"); data/mupen64plus-rsp-hle-2.5.9/src/hle.c:448: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). f = fopen(filename, "wb"); data/mupen64plus-rsp-hle-2.5.9/src/hle.c:463: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). f = fopen(filename, "r"); data/mupen64plus-rsp-hle-2.5.9/src/hle.c:465: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). f = fopen(filename, "w"); data/mupen64plus-rsp-hle-2.5.9/src/memory.c:48: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(dst, u32(buffer, address), count * sizeof(uint32_t)); data/mupen64plus-rsp-hle-2.5.9/src/memory.c:72: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(u32(buffer, address), src, count * sizeof(uint32_t)); data/mupen64plus-rsp-hle-2.5.9/src/mp3.c:226: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(hle->mp3_buffer + 0xCE8, hle->dram + readPtr, 8); data/mupen64plus-rsp-hle-2.5.9/src/mp3.c:232:9: [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(hle->mp3_buffer + 0xCF0, hle->dram + readPtr, 0x180); data/mupen64plus-rsp-hle-2.5.9/src/mp3.c:250:9: [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(hle->dram + writePtr, hle->mp3_buffer + 0xe70, 0x180); data/mupen64plus-rsp-hle-2.5.9/src/musyx.c:635:9: [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, frame, 2 * sizeof(frame[0])); data/mupen64plus-rsp-hle-2.5.9/src/musyx.c:848: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(buffer, musyx->subframe_740_last4, 4 * sizeof(int16_t)); data/mupen64plus-rsp-hle-2.5.9/src/musyx.c:849: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(musyx->subframe_740_last4, subframe + SUBFRAME_SIZE - 4, 4 * sizeof(int16_t)); data/mupen64plus-rsp-hle-2.5.9/src/plugin.c:192: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 msgbuf[1024]; data/mupen64plus-rsp-hle-2.5.9/src/plugin.c:118:38: [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 (rsp_fallback_path == NULL || strlen(rsp_fallback_path) == 0) { ANALYSIS SUMMARY: Hits = 40 Lines analyzed = 6943 in approximately 0.21 seconds (33389 lines/second) Physical Source Lines of Code (SLOC) = 4987 Hits@level = [0] 1 [1] 1 [2] 37 [3] 1 [4] 1 [5] 0 Hits@level+ = [0+] 41 [1+] 40 [2+] 39 [3+] 2 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 8.22138 [1+] 8.02085 [2+] 7.82033 [3+] 0.401043 [4+] 0.200521 [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.