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/avarice-2.14/src/jtagbp.cc Examining data/avarice-2.14/src/jtag1.h Examining data/avarice-2.14/src/gnu_getopt.c Examining data/avarice-2.14/src/jtag2usb.cc Examining data/avarice-2.14/src/remote.h Examining data/avarice-2.14/src/jtag3prog.cc Examining data/avarice-2.14/src/jtag3misc.cc Examining data/avarice-2.14/src/jtag3rw.cc Examining data/avarice-2.14/src/jtagrun.cc Examining data/avarice-2.14/src/jtagio.cc Examining data/avarice-2.14/src/jtag2.h Examining data/avarice-2.14/src/jtag.h Examining data/avarice-2.14/src/pragma.h Examining data/avarice-2.14/src/jtag2rw.cc Examining data/avarice-2.14/src/jtag2run.cc Examining data/avarice-2.14/src/gnu_getopt1.c Examining data/avarice-2.14/src/utils.cc Examining data/avarice-2.14/src/crc16.c Examining data/avarice-2.14/src/jtag3.h Examining data/avarice-2.14/src/jtagmisc.cc Examining data/avarice-2.14/src/jtagprog.cc Examining data/avarice-2.14/src/jtag3run.cc Examining data/avarice-2.14/src/remote.cc Examining data/avarice-2.14/src/ioreg.cc Examining data/avarice-2.14/src/jtag3io.cc Examining data/avarice-2.14/src/jtaggeneric.cc Examining data/avarice-2.14/src/avarice.h Examining data/avarice-2.14/src/devdescr.cc Examining data/avarice-2.14/src/jtag2bp.cc Examining data/avarice-2.14/src/gnu_getopt.h Examining data/avarice-2.14/src/jtag3bp.cc Examining data/avarice-2.14/src/main.cc Examining data/avarice-2.14/src/crc16.h Examining data/avarice-2.14/src/jtag2io.cc Examining data/avarice-2.14/src/ioreg.h Examining data/avarice-2.14/src/jtag2misc.cc Examining data/avarice-2.14/src/jtag2prog.cc Examining data/avarice-2.14/src/jtag2_defs.h Examining data/avarice-2.14/src/jtagrw.cc FINAL RESULTS: data/avarice-2.14/src/remote.cc:274:2: [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. vsnprintf(textbuf, BUFMAX, fmt, args); data/avarice-2.14/src/remote.cc:622:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(reply, "AVaRICE version %s, %s %s\n", data/avarice-2.14/src/remote.cc:638:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(reply, "Failed to reset MCU: %s\n", data/avarice-2.14/src/remote.cc:969:29: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(&remcomOutBuffer[offset], data/avarice-2.14/src/remote.cc:1008:41: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(&remcomOutBuffer[offset], data/avarice-2.14/src/utils.cc:36:15: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. (void)vfprintf(stderr, fmt, args); data/avarice-2.14/src/utils.cc:50:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, args); data/avarice-2.14/src/gnu_getopt.c:218:9: [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. #ifndef getenv data/avarice-2.14/src/gnu_getopt.c:219:14: [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. extern char *getenv (); data/avarice-2.14/src/gnu_getopt.c:414:21: [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. posixly_correct = getenv ("POSIXLY_CORRECT"); data/avarice-2.14/src/gnu_getopt.c:980:1: [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. getopt (argc, argv, optstring) data/avarice-2.14/src/gnu_getopt.c:1010:11: [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. c = getopt (argc, argv, "abc:d:0123456789"); data/avarice-2.14/src/gnu_getopt.h:125:12: [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. extern int getopt (int argc, char *const *argv, const char *shortopts); data/avarice-2.14/src/gnu_getopt.h:128:12: [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. extern int getopt (); data/avarice-2.14/src/gnu_getopt.h:131:12: [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. extern int getopt_long (int argc, char *const *argv, const char *shortopts, data/avarice-2.14/src/gnu_getopt.h:143:12: [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. extern int getopt (); data/avarice-2.14/src/gnu_getopt.h:144:12: [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. extern int getopt_long (); data/avarice-2.14/src/gnu_getopt1.c:69:1: [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. getopt_long (argc, argv, options, long_options, opt_index) data/avarice-2.14/src/gnu_getopt1.c:125:11: [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. c = getopt_long (argc, argv, "abc:d:0123456789", data/avarice-2.14/src/main.cc:392:17: [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 c = getopt_long (argc, argv, "1234B:Cc:DdeE:f:ghIj:kL:lP:pRrVvwW:xX", data/avarice-2.14/src/main.cc:573:18: [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. char *cp = getenv ("JTAG_DEV"); data/avarice-2.14/src/jtag.h: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. unsigned char rd[8]; // IO read access. data/avarice-2.14/src/jtag.h:49: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. unsigned char wr[8]; // IO write access. data/avarice-2.14/src/jtag.h:50: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. unsigned char sh_rd[8]; // IO shadow read access. data/avarice-2.14/src/jtag.h:51: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. unsigned char sh_wr[8]; // IO shadow write access. data/avarice-2.14/src/jtag.h:56: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. unsigned char ext_rd[20]; // Extended IO read access. data/avarice-2.14/src/jtag.h:57: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. unsigned char ext_wr[20]; // Extended IO write access. data/avarice-2.14/src/jtag.h:58: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. unsigned char ext_sh_rd[20]; // Extended IO shadow read access. data/avarice-2.14/src/jtag.h:59: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. unsigned char ext_sh_wr[20]; // Extended IO shadow write access. data/avarice-2.14/src/jtag.h:69: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. unsigned char flash_pg_sz[2]; // [0]->little end; [1]->big end data/avarice-2.14/src/jtag.h:72: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. unsigned char boot_addr[4]; // Boot loader start address. data/avarice-2.14/src/jtag.h:79: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. unsigned char eom[2]; // JTAG command terminator. data/avarice-2.14/src/jtag.h:91: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. unsigned char ucReadIO[8]; //LSB = IOloc 0, MSB = IOloc63 data/avarice-2.14/src/jtag.h:92: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. unsigned char ucReadIOShadow[8]; //LSB = IOloc 0, MSB = IOloc63 data/avarice-2.14/src/jtag.h: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. unsigned char ucWriteIO[8]; //LSB = IOloc 0, MSB = IOloc63 data/avarice-2.14/src/jtag.h:94: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. unsigned char ucWriteIOShadow[8]; //LSB = IOloc 0, MSB = IOloc63 data/avarice-2.14/src/jtag.h:95: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. unsigned char ucReadExtIO[52]; //LSB = IOloc 96, MSB = IOloc511 data/avarice-2.14/src/jtag.h:96: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. unsigned char ucReadIOExtShadow[52]; //LSB = IOloc 96, MSB = IOloc511 data/avarice-2.14/src/jtag.h:97: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. unsigned char ucWriteExtIO[52]; //LSB = IOloc 96, MSB = IOloc511 data/avarice-2.14/src/jtag.h:98: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. unsigned char ucWriteIOExtShadow[52];//LSB = IOloc 96, MSB = IOloc511 data/avarice-2.14/src/jtag.h:103: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. unsigned char uiFlashPageSize[2]; //Device Flash Page Size data/avarice-2.14/src/jtag.h:105: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. unsigned char ulBootAddress[4]; //Device Boot Loader Start Address data/avarice-2.14/src/jtag.h:106: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. unsigned char uiUpperExtIOLoc[2]; //Topmost (last) extended I/O data/avarice-2.14/src/jtag.h:108: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. unsigned char ulFlashSize[4]; //Device Flash Size data/avarice-2.14/src/jtag.h:109: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. unsigned char ucEepromInst[20]; //Instructions for W/R EEPROM data/avarice-2.14/src/jtag.h:110: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. unsigned char ucFlashInst[3]; //Instructions for W/R FLASH data/avarice-2.14/src/jtag.h:114: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. unsigned char uiFlashpages[2]; // number of pages in flash data/avarice-2.14/src/jtag.h:120: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. unsigned char uiStartSmallestBootLoaderSection[2]; // data/avarice-2.14/src/jtag.h:128: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. unsigned char uiSramStartAddr[2]; // Start of SRAM data/avarice-2.14/src/jtag.h:135: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. unsigned char EECRAddress[2]; // EECR IO address data/avarice-2.14/src/jtag.h:141: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. unsigned char whatever[2]; // cannot guess; must be 0x0002 data/avarice-2.14/src/jtag.h:143: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. unsigned char nvm_app_offset[4]; // NVM offset for application flash data/avarice-2.14/src/jtag.h:144: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. unsigned char nvm_boot_offset[4]; // NVM offset for boot flash data/avarice-2.14/src/jtag.h:145: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. unsigned char nvm_eeprom_offset[4]; // NVM offset for EEPROM data/avarice-2.14/src/jtag.h:146: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. unsigned char nvm_fuse_offset[4]; // NVM offset for fuses data/avarice-2.14/src/jtag.h:147: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. unsigned char nvm_lock_offset[4]; // NVM offset for lock bits data/avarice-2.14/src/jtag.h:148: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. unsigned char nvm_user_sig_offset[4]; // NVM offset for user signature row data/avarice-2.14/src/jtag.h:149: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. unsigned char nvm_prod_sig_offset[4]; // NVM offset for production sign. row data/avarice-2.14/src/jtag.h:150: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. unsigned char nvm_data_offset[4]; // NVM offset for data memory (SRAM + IO) data/avarice-2.14/src/jtag.h:151: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. unsigned char app_size[4]; // size of application flash data/avarice-2.14/src/jtag.h:152: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. unsigned char boot_size[2]; // size of boot flash data/avarice-2.14/src/jtag.h:153: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. unsigned char flash_page_size[2]; // flash page size data/avarice-2.14/src/jtag.h:154: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. unsigned char eeprom_size[2]; // size of EEPROM data/avarice-2.14/src/jtag.h:156: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. unsigned char nvm_base_addr[2]; // IO space base address of NVM controller data/avarice-2.14/src/jtag.h:157: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. unsigned char mcu_base_addr[2]; // IO space base address of MCU control data/avarice-2.14/src/jtag.h:162: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. unsigned char flash_page_size[2]; // in bytes data/avarice-2.14/src/jtag.h:163: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. unsigned char flash_size[4]; // in bytes data/avarice-2.14/src/jtag.h:164: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. unsigned char dummy1[4]; // always 0 data/avarice-2.14/src/jtag.h:165: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. unsigned char boot_address[4]; // maximal (BOOTSZ = 3) bootloader data/avarice-2.14/src/jtag.h:167: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. unsigned char sram_offset[2]; // pointing behind IO registers data/avarice-2.14/src/jtag.h:168: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. unsigned char eeprom_size[2]; data/avarice-2.14/src/jtag.h:179: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. unsigned char dummy2[2]; // always 0 data/avarice-2.14/src/jtag2.h:42: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. unsigned char flashCache[MAX_FLASH_PAGE_SIZE]; data/avarice-2.14/src/jtag2.h: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. unsigned char eepromCache[MAX_EEPROM_PAGE_SIZE]; data/avarice-2.14/src/jtag2_defs.h:237:12: [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 ucReadIO[8]; /*LSB = IOloc 0, MSB = IOloc63 */ data/avarice-2.14/src/jtag2_defs.h:238:12: [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 ucReadIOShadow[8]; /*LSB = IOloc 0, MSB = IOloc63 */ data/avarice-2.14/src/jtag2_defs.h:239:12: [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 ucWriteIO[8]; /*LSB = IOloc 0, MSB = IOloc63 */ data/avarice-2.14/src/jtag2_defs.h:240:12: [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 ucWriteIOShadow[8]; /*LSB = IOloc 0, MSB = IOloc63 */ data/avarice-2.14/src/jtag2_defs.h:241:12: [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 ucReadExtIO[52]; /*LSB = IOloc 96, MSB = IOloc511 */ data/avarice-2.14/src/jtag2_defs.h:242:12: [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 ucReadIOExtShadow[52]; /*LSB = IOloc 96, MSB = IOloc511 */ data/avarice-2.14/src/jtag2_defs.h:243:12: [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 ucWriteExtIO[52]; /*LSB = IOloc 96, MSB = IOloc511 */ data/avarice-2.14/src/jtag2_defs.h:244:12: [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 ucWriteIOExtShadow[52];/*LSB = IOloc 96, MSB = IOloc511 */ data/avarice-2.14/src/jtag2_defs.h:249:12: [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 uiFlashPageSize[2]; /*Device Flash Page Size, Size = */ data/avarice-2.14/src/jtag2_defs.h:252:12: [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 ulBootAddress[4]; /*Device Boot Loader Start Address */ data/avarice-2.14/src/jtag2_defs.h:253:12: [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 uiUpperExtIOLoc[2]; /*Topmost (last) extended I/O */ data/avarice-2.14/src/jtag2_defs.h:255:12: [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 ulFlashSize[4]; /*Device Flash Size */ data/avarice-2.14/src/jtag2_defs.h:256:12: [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 ucEepromInst[20]; /*Instructions for W/R EEPROM */ data/avarice-2.14/src/jtag2_defs.h:257:12: [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 ucFlashInst[3]; /*Instructions for W/R FLASH */ data/avarice-2.14/src/jtag2_defs.h:261:12: [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 uiFlashpages[2]; /* number of pages in flash */ data/avarice-2.14/src/jtag2_defs.h:267:12: [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 uiStartSmallestBootLoaderSection[2]; /* */ data/avarice-2.14/src/jtag2_defs.h:275:12: [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 uiSramStartAddr[2]; /* Start of SRAM */ data/avarice-2.14/src/jtag2_defs.h:282:12: [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 EECRAddress[2]; /* EECR memory-mapped IO address */ data/avarice-2.14/src/jtag2io.cc:46:12: [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 buffer[50]; data/avarice-2.14/src/jtag2io.cc:120: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(buf + 8, command, commandSize); data/avarice-2.14/src/jtag2io.cc:235: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(buf, header, 8); data/avarice-2.14/src/jtag2io.cc:827: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. unsigned char buf[4]; data/avarice-2.14/src/jtag2misc.cc: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. unsigned char buf[2 + 4], *resp; data/avarice-2.14/src/jtag2misc.cc:51: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(buf + 2, newValue, valSize); data/avarice-2.14/src/jtag2misc.cc:78: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. unsigned char buf[2]; data/avarice-2.14/src/jtag2rw.cc:167:3: [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(response + targetOffset, data/avarice-2.14/src/jtag2rw.cc:186:3: [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(cachePtr, resp + 1, pageSize); data/avarice-2.14/src/jtag2rw.cc:188:3: [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(response + targetOffset, data/avarice-2.14/src/jtag2rw.cc:287: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(command + 10, bp, chunksize); data/avarice-2.14/src/jtag2usb.cc:255: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 string[256]; data/avarice-2.14/src/jtag2usb.cc:297:3: [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(devnamecopy, jtagDeviceName, x); data/avarice-2.14/src/jtag2usb.cc:589:3: [2] (buffer) wchar_t: 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. wchar_t wserno[15]; data/avarice-2.14/src/jtag2usb.cc:593:3: [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(devnamecopy, jtagDeviceName, x); data/avarice-2.14/src/jtag2usb.cc:695:12: [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 probebuf[512 + 1] = { data/avarice-2.14/src/jtag2usb.cc:755:7: [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[MAX_MESSAGE]; data/avarice-2.14/src/jtag2usb.cc:756:7: [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 rbuf[MAX_MESSAGE + sizeof(unsigned int)]; data/avarice-2.14/src/jtag2usb.cc:757:7: [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 ebuf[USBDEV_MAX_EVT_3 + sizeof(unsigned int)]; data/avarice-2.14/src/jtag2usb.cc:930: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(rbuf, &pkt_len, sizeof(unsigned int)); data/avarice-2.14/src/jtag2usb.cc:977: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(ebuf, &pkt_len, sizeof(unsigned int)); data/avarice-2.14/src/jtag2usb.cc:1003:7: [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[MAX_MESSAGE]; data/avarice-2.14/src/jtag2usb.cc:1050:7: [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[MAX_MESSAGE + sizeof(unsigned int)]; data/avarice-2.14/src/jtag2usb.cc:1120:6: [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(buf, &pkt_len, sizeof(unsigned int)); data/avarice-2.14/src/jtag2usb.cc:1144:7: [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[USBDEV_MAX_EVT_3 + sizeof(unsigned int)]; data/avarice-2.14/src/jtag2usb.cc:1176: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(buf, &pkt_len, sizeof(unsigned int)); data/avarice-2.14/src/jtag2usb.cc:1220:16: [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[MAX_MESSAGE + 5]; data/avarice-2.14/src/jtag2usb.cc:1272: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(buf, &len, sizeof(unsigned int)); data/avarice-2.14/src/jtag2usb.cc:1392:3: [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(buf, &totlength, sizeof(unsigned int)); data/avarice-2.14/src/jtag3.h:191: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. unsigned char flashCache[MAX_FLASH_PAGE_SIZE]; data/avarice-2.14/src/jtag3.h:193: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. unsigned char eepromCache[MAX_EEPROM_PAGE_SIZE]; data/avarice-2.14/src/jtag3io.cc:42: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. static char buffer[50]; data/avarice-2.14/src/jtag3io.cc:127: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(buf + 4, command, commandSize); data/avarice-2.14/src/jtag3io.cc:201: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(msg, tempbuf + 4, rv); data/avarice-2.14/src/jtag3io.cc:210: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(msg, tempbuf + 3, rv); data/avarice-2.14/src/jtag3io.cc:383: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(d3.flash_page_size, dev->dev_desc2.uiFlashPageSize, 2); data/avarice-2.14/src/jtag3io.cc:384: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(d3.flash_size, dev->dev_desc2.ulFlashSize, 4); data/avarice-2.14/src/jtag3io.cc: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(d3.boot_address, dev->dev_desc2.ulBootAddress, 4); data/avarice-2.14/src/jtag3io.cc:386: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(d3.sram_offset, dev->dev_desc2.uiSramStartAddr, 2); data/avarice-2.14/src/jtag3io.cc:763: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. unsigned char buf[4]; data/avarice-2.14/src/jtag3misc.cc:48:3: [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(buf + 6, newValue, valSize); data/avarice-2.14/src/jtag3misc.cc:73:12: [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[6]; data/avarice-2.14/src/jtag3rw.cc:166:3: [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(response + targetOffset, data/avarice-2.14/src/jtag3rw.cc:185:3: [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(cachePtr, resp + 3, pageSize); data/avarice-2.14/src/jtag3rw.cc:187:3: [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(response + targetOffset, data/avarice-2.14/src/jtag3rw.cc:301: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(cmd + 13, buffer, numBytes); data/avarice-2.14/src/jtaggeneric.cc:92: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). jtagBox = open(jtagDeviceName, O_RDWR | O_NOCTTY | O_NONBLOCK); data/avarice-2.14/src/jtaggeneric.cc:549: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. const char *fusenames[3] = { " Low", data/avarice-2.14/src/jtagio.cc:97: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 infobuf[2]; data/avarice-2.14/src/jtagrw.cc:240: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(&txBuffer[1], buffer, numBytes); data/avarice-2.14/src/remote.cc:59: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. static char remcomInBuffer[BUFMAX]; data/avarice-2.14/src/remote.cc:60: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. static char remcomOutBuffer[BUFMAX]; data/avarice-2.14/src/remote.cc:270: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 textbuf[BUFMAX], hexbuf[2 * BUFMAX], *textscan, *hexscan; data/avarice-2.14/src/remote.cc:516: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[16]; data/avarice-2.14/src/remote.cc:577:5: [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(remcomOutBuffer, "OK"); data/avarice-2.14/src/remote.cc:621: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. char reply[80]; data/avarice-2.14/src/remote.cc:637:13: [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 reply[80]; data/avarice-2.14/src/remote.cc:680: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. i += sprintf(r + i, "\\x%02x", (unsigned)c & 0xff); data/avarice-2.14/src/remote.cc:855: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(regBuffer, jtagBuffer, 0x20); data/avarice-2.14/src/remote.cc:937:21: [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(remcomOutBuffer, "%02x", regcount); data/avarice-2.14/src/remote.cc:1027:6: [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(remcomOutBuffer, "qXfer:memory-map:read+"); data/avarice-2.14/src/remote.cc:1031:4: [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(remcomOutBuffer, data/avarice-2.14/src/remote.cc:1049:13: [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 cmdbuf[MONMAX]; data/avarice-2.14/src/remote.cc:1230:6: [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(flashbuf + offset, ptr, amount); data/avarice-2.14/src/gnu_getopt.c:241:51: [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 (!defined __STDC__ || !__STDC__) && !defined strlen data/avarice-2.14/src/gnu_getopt.c:244:12: [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). extern int strlen (const char *); data/avarice-2.14/src/gnu_getopt.c:445:44: [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). int len = nonoption_flags_max_len = strlen (orig_str); data/avarice-2.14/src/gnu_getopt.c:667:21: [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). == (unsigned int) strlen (p->name)) data/avarice-2.14/src/gnu_getopt.c:691: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). nextchar += strlen (nextchar); data/avarice-2.14/src/gnu_getopt.c:722:21: [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). nextchar += strlen (nextchar); data/avarice-2.14/src/gnu_getopt.c:739: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). nextchar += strlen (nextchar); data/avarice-2.14/src/gnu_getopt.c:744: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). nextchar += strlen (nextchar); data/avarice-2.14/src/gnu_getopt.c:855:51: [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 ((unsigned int) (nameend - nextchar) == strlen (p->name)) data/avarice-2.14/src/gnu_getopt.c:878:18: [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). nextchar += strlen (nextchar); data/avarice-2.14/src/gnu_getopt.c:898:19: [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). nextchar += strlen (nextchar); data/avarice-2.14/src/gnu_getopt.c:912:19: [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). nextchar += strlen (nextchar); data/avarice-2.14/src/gnu_getopt.c:916:18: [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). nextchar += strlen (nextchar); data/avarice-2.14/src/jtag2usb.cc:296:30: [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). devnamecopy = new char[x = strlen(jtagDeviceName) + 1]; data/avarice-2.14/src/jtag2usb.cc:316:8: [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). x = strlen(cp2) - 1; data/avarice-2.14/src/jtag2usb.cc:321: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). if (strlen(serno) > 12) data/avarice-2.14/src/jtag2usb.cc:383:12: [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). x = strlen(string) - strlen(serno); data/avarice-2.14/src/jtag2usb.cc:383:29: [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). x = strlen(string) - strlen(serno); data/avarice-2.14/src/jtag2usb.cc:427:13: [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). x = strlen(string) - strlen(serno); data/avarice-2.14/src/jtag2usb.cc:427:30: [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). x = strlen(string) - strlen(serno); data/avarice-2.14/src/jtag2usb.cc:592:30: [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). devnamecopy = new char[x = strlen(jtagDeviceName) + 1]; data/avarice-2.14/src/jtag2usb.cc:612:8: [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). x = strlen(cp2) - 1; data/avarice-2.14/src/jtag2usb.cc:617: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). serlen = strlen(serno); data/avarice-2.14/src/jtag2usb.cc:656:18: [1] (buffer) wcslen: 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). size_t slen = wcslen(walk->serial_number); data/avarice-2.14/src/jtag2usb.cc:804:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((rv = read(pype[0], buf, MAX_MESSAGE)) > 0) data/avarice-2.14/src/jtag2usb.cc:1006:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((rv = read(pype[0], buf, MAX_MESSAGE)) > 0) data/avarice-2.14/src/jtag2usb.cc:1291:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((rv = read(pype[0], buf + 5, MAX_MESSAGE)) > 0) data/avarice-2.14/src/jtaggeneric.cc:169:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t thisread = read(jtagBox, &buffer[actual], count - actual); data/avarice-2.14/src/jtaggeneric.cc:589: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(lock) != 2) data/avarice-2.14/src/jtagio.cc:288:2: [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(2 * JTAG_COMM_TIMEOUT); // let rest of response come before we ignore it data/avarice-2.14/src/main.cc:509:19: [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). int len = strlen (arg); data/avarice-2.14/src/main.cc:520:13: [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 (host)) { data/avarice-2.14/src/remote.cc:133:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). result = read(gdbFileDescriptor, &c, 1); data/avarice-2.14/src/remote.cc:155:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). result = read(gdbFileDescriptor, &c, 1); data/avarice-2.14/src/remote.cc:608:23: [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). unsigned int ln = strlen(cmd); data/avarice-2.14/src/remote.cc:913:18: [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). length = strlen("Ravr.io_reg"); data/avarice-2.14/src/remote.cc:968: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). offset = strlen(remcomOutBuffer); data/avarice-2.14/src/remote.cc:1007:50: [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). offset = strlen(remcomOutBuffer); ANALYSIS SUMMARY: Hits = 194 Lines analyzed = 29641 in approximately 0.91 seconds (32504 lines/second) Physical Source Lines of Code (SLOC) = 24712 Hits@level = [0] 215 [1] 38 [2] 135 [3] 14 [4] 7 [5] 0 Hits@level+ = [0+] 409 [1+] 194 [2+] 156 [3+] 21 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 16.5507 [1+] 7.85044 [2+] 6.31272 [3+] 0.84979 [4+] 0.283263 [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.