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/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_source.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_common.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blip/Blip_Buffer.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_config.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mednafen.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/file.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/git.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/eeprom.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/eeprom.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/wswan.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/gfx.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/dis_tables.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/disasm.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/dis_decode.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/resolve.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/syntax.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/dis_groups.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/v30mz.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/sound.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/wswan-memory.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/debug.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/interrupt.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/rtc.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/v30mz.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/interrupt.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/wswan-memory.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/rtc.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/tcache.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/v30mz-private.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/sound.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/gfx.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/debug.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mempatcher-driver.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/settings-driver.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mempatcher.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/settings.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mednafen-endian.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/state.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mednafen-endian.c Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mednafen-types.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/msvc_compat.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/state.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/general.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/sound/Blip_Buffer.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mednafen.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/settings.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mednafen-driver.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/masmem.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/file.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/driver.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/general.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/video.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mempatcher.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/settings-common.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/math_ops.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/msvc.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/getopt.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/msvc/stdint.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/apple_compat.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/posix_string.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/strl.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/intrinsics.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/strcasestr.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/ifaddrs.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/fnmatch.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/retro_miscellaneous.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/libco.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/memmap.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/retro_common.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/boolean.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/retro_common_api.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/retro_inline.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/retro_stat.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/scrc32.c Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/msvc/msvc-2003-xbox1/stdint.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro.cpp Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro.h Examining data/libretro-beetle-wswan-0.9.35.1+git20160623/scrc32.h FINAL RESULTS: data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/msvc.h:36:12: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf c99_snprintf data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/msvc.h:37:12: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define vsnprintf c99_vsnprintf data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mempatcher.cpp:471:10: [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(next->name,name); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/msvc_compat.h:35:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf _snprintf data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/msvc_compat.h:35:18: [4] (format) _snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf _snprintf data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/debug.cpp:354:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(text_buffer, tmp); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/dis_decode.cpp:246:3: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(disbufptr, fmt, ap); data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/getopt.h:39:9: [3] (buffer) getopt_long: 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. #define getopt_long(argc, argv, optstring, longopts, longindex) __getopt_long_retro(argc, argv, optstring, longopts, longindex) data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/compat/getopt.h:56:5: [3] (buffer) getopt_long: 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. int getopt_long(int argc, char *argv[], data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro.cpp:215:4: [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(wsCartROM + (rom_size - real_rom_size), GET_FDATA_PTR(fp), GET_FSIZE_PTR(fp)); data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro.cpp:217:4: [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(header, wsCartROM + rom_size - 10, 10); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/file.cpp:82: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). if (!(fp = fopen(path, "rb"))) data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/file.cpp:115:4: [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*)ptr, f_data + location, nmemb); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/file.cpp:172: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). FILE *fp = fopen(filename, "wb"); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/git.h:72: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. const char *RotateName[3]; // 90, 180, 270 data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h:68:21: [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. return ((unsigned char const*) p) [1] * 0x100u + data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h:69:15: [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 const*) p) [0]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h:72:21: [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. return ((unsigned char const*) p) [0] * 0x100u + data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h:73:15: [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 const*) p) [1]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h:76:21: [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. return ((unsigned char const*) p) [3] * 0x01000000u + data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h:77:15: [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 const*) p) [2] * 0x00010000u + data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h:78:15: [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 const*) p) [1] * 0x00000100u + data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h:79:15: [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 const*) p) [0]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h:82:21: [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. return ((unsigned char const*) p) [0] * 0x01000000u + data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h:83:15: [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 const*) p) [1] * 0x00010000u + data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h:84:15: [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 const*) p) [2] * 0x00000100u + data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blargg_endian.h:85:15: [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 const*) p) [3]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mednafen.h:24:22: [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). #define gzopen(a, b) fopen(a, b) data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mempatcher.cpp:261: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 address[64]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mempatcher.cpp:262: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 operation[64]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mempatcher.cpp:263: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 value[64]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/state.cpp:33: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(buffer, st->data + st->loc, len); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/state.cpp:50: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(st->data + st->loc, buffer, len); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/state.cpp:140: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 nameo[1 + 256]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/state.cpp:417: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. char sname[32]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/state.cpp:494: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(header, header_magic, 8); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/debug.cpp:352: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 tmp[16]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/debug.cpp:361:4: [2] (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). Risk is low because the source is a constant string. strcpy(text_buffer, "BORKBORK"); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/dis_decode.cpp:28:23: [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 const unsigned char instruction_has_modrm[512] = { data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/disasm.h:134: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 *sreg_mod01or10_rm32[8]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/disasm.h:135: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 *sreg_mod00_base32[8]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/disasm.h:136: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 *sreg_mod01or10_base32[8]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/disasm.h:137: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 *sreg_mod00_rm16[8]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/disasm.h:138: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 *sreg_mod01or10_rm16[8]; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/syntax.cpp:12:14: [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 const char *intel_general_16bit_regname[8] = { data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/syntax.cpp:16:14: [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 const char *intel_general_8bit_regname[8] = { data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/syntax.cpp:20:14: [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 const char *intel_segment_name[8] = { data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/syntax.cpp:24:14: [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 const char *intel_index16[8] = { data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/syntax.cpp:40:14: [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 const char *att_general_16bit_regname[8] = { data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/syntax.cpp:44:14: [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 const char *att_general_8bit_regname[8] = { data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/syntax.cpp:48:14: [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 const char *att_segment_name[8] = { data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/syntax.cpp:52:14: [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 const char *att_index16[8] = { data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/eeprom.cpp:213:4: [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(iEEPROM, iEEPROM_Init, 0x400); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/gfx.cpp:287:7: [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(SpriteTable, &wsRAM[(SPRBase << 9) + (SpriteStart << 2)], SpriteCountCache << 2); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/interrupt.cpp:93:14: [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 const char *PrettyINames[8] = { "Serial Send", "Key Press", "RTC Alarm", "Serial Recv", "Line Hit", "VBlank Timer", "VBlank", "HBlank Timer" }; data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/tcache.cpp:198:10: [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(&wsTileRow[0],&wsTCacheFlipped[(number<<6)|(line<<3)],8); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/tcache.cpp:200:10: [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(&wsTileRow[0],&wsTCache[(number<<6)|(line<<3)],8); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/tcache.cpp:297:10: [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(&wsTileRow[0],&wsTCacheFlipped2[(number<<6)|(line<<3)],8); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/tcache.cpp:299:10: [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(&wsTileRow[0],&wsTCache2[(number<<6)|(line<<3)],8); data/libretro-beetle-wswan-0.9.35.1+git20160623/libretro-common/include/retro_miscellaneous.h:101: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(1000 * msec); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/include/blip/Blip_Buffer.h:307:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). blip_long read() const { return accum >> (blip_sample_bits - 16); } data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mednafen.cpp:79: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). for(x=0;x<strlen((char *)MDFNGameInfo->name);x++) data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mednafen.h:27:19: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define gzgetc(a) fgetc(a) data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mempatcher.cpp:269:10: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. while(sscanf(string, "%u %c %63s %63s %63s", &bytelen, &endian, address, operation, value) == 5 && passed) data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mempatcher.cpp:438: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(str)!=8) return(0); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/mempatcher.cpp:468:40: [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((t=(char *)realloc(next->name,strlen(name+1)))) data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/msvc_compat.h:44: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). #define strlen _tcslen data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/msvc_compat.h:44:16: [1] (buffer) _tcslen: 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). #define strlen _tcslen data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/state.cpp:214:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((char *)sname_tmp, sname, 32); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/state.cpp:216:5: [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(sname) > 32) data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/debug.cpp:346:10: [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). for(x = strlen(text_buffer); x < 40; x++) data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/dis/dis_decode.cpp:249:16: [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). disbufptr += strlen(disbufptr); data/libretro-beetle-wswan-0.9.35.1+git20160623/mednafen/wswan/eeprom.cpp:219:14: [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(x < strlen(Name)) ANALYSIS SUMMARY: Hits = 73 Lines analyzed = 15409 in approximately 0.48 seconds (31973 lines/second) Physical Source Lines of Code (SLOC) = 10356 Hits@level = [0] 30 [1] 14 [2] 50 [3] 2 [4] 7 [5] 0 Hits@level+ = [0+] 103 [1+] 73 [2+] 59 [3+] 9 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 9.94593 [1+] 7.04905 [2+] 5.69718 [3+] 0.869061 [4+] 0.675937 [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.