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/s51dude-0.3.1/ihex.c Examining data/s51dude-0.3.1/ihex.h Examining data/s51dude-0.3.1/parse_params.c Examining data/s51dude-0.3.1/parts.c Examining data/s51dude-0.3.1/parts.h Examining data/s51dude-0.3.1/s51dude.c Examining data/s51dude-0.3.1/s51dude.h Examining data/s51dude-0.3.1/usbtiny.c Examining data/s51dude-0.3.1/usbtiny.h FINAL RESULTS: data/s51dude-0.3.1/parse_params.c:138:3: [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(options.path,archivo); data/s51dude-0.3.1/parse_params.c:54:18: [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. short_option = getopt_long (argc, argv, ALLOWED_SHORT_ARGUMENTS, long_options, &option_index); data/s51dude-0.3.1/ihex.c:25: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(ihexRecord->data, data, dataLen); data/s51dude-0.3.1/ihex.c:34: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 recordBuff[IHEX_RECORD_BUFF_SIZE]; data/s51dude-0.3.1/ihex.c:36: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 hexBuff[IHEX_ADDRESS_LEN+1]; data/s51dude-0.3.1/parts.c:54:11: [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 res[4]; data/s51dude-0.3.1/parts.c:75:11: [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 res[4]; data/s51dude-0.3.1/parts.c:86:11: [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 res[4]; data/s51dude-0.3.1/parts.c:96:11: [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 res[4]; data/s51dude-0.3.1/parts.c:106:11: [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 res[4]; data/s51dude-0.3.1/s51dude.c:95:11: [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 res[4]; data/s51dude-0.3.1/s51dude.c:103:11: [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 res[4]; data/s51dude-0.3.1/s51dude.c:178: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(code_buffer+buffer_hex.address, &(buffer_hex.data), buffer_hex.dataLen); data/s51dude-0.3.1/s51dude.c:423:19: [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). options.file = fopen (options.path, "r"); data/s51dude-0.3.1/s51dude.c:438:19: [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). options.file = fopen (options.path, "w"); data/s51dude-0.3.1/s51dude.h:112: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 text_micro[MAX_T_MICRO]; data/s51dude-0.3.1/s51dude.h:172:38: [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. int usbtiny_trasnparent_spi(unsigned char cmd[4], unsigned char res[4]); data/s51dude-0.3.1/s51dude.h:172:60: [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. int usbtiny_trasnparent_spi(unsigned char cmd[4], unsigned char res[4]); data/s51dude-0.3.1/usbtiny.c:202:38: [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. int usbtiny_trasnparent_spi(unsigned char cmd[4], unsigned char res[SPI_CMD_LEN]) data/s51dude-0.3.1/usbtiny.c:202:60: [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. int usbtiny_trasnparent_spi(unsigned char cmd[4], unsigned char res[SPI_CMD_LEN]) data/s51dude-0.3.1/ihex.c:51: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). recordBuff[strlen(recordBuff)-1] = 0; data/s51dude-0.3.1/ihex.c:54:6: [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(recordBuff) < 1+IHEX_COUNT_LEN+IHEX_ADDRESS_LEN+IHEX_TYPE_LEN) data/s51dude-0.3.1/ihex.c:62:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(hexBuff, recordBuff+IHEX_COUNT_OFFSET, IHEX_COUNT_LEN); data/s51dude-0.3.1/ihex.c:67:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(hexBuff, recordBuff+IHEX_ADDRESS_OFFSET, IHEX_ADDRESS_LEN); data/s51dude-0.3.1/ihex.c:72:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(hexBuff, recordBuff+IHEX_TYPE_OFFSET, IHEX_TYPE_LEN); data/s51dude-0.3.1/ihex.c:77:6: [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(recordBuff) < 1+IHEX_COUNT_LEN+IHEX_ADDRESS_LEN+IHEX_TYPE_LEN+dataCount*2+IHEX_CHECKSUM_LEN) data/s51dude-0.3.1/ihex.c:84:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(hexBuff, recordBuff+IHEX_DATA_OFFSET+2*i, IHEX_ASCII_HEX_BYTE_LEN); data/s51dude-0.3.1/ihex.c:91:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(hexBuff, recordBuff+IHEX_DATA_OFFSET+dataCount*2, IHEX_CHECKSUM_LEN); data/s51dude-0.3.1/parse_params.c:132:34: [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). options.path=(char *) malloc ((strlen(archivo)+1)*sizeof(char)); data/s51dude-0.3.1/parts.c:27:9: [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. #define usleep(useconds) Sleep(useconds / 1000) data/s51dude-0.3.1/parts.h:41:9: [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. #define usleep(useconds) Sleep(useconds / 1000) data/s51dude-0.3.1/s51dude.c:40:9: [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. #define usleep(useconds) Sleep(useconds / 1000) data/s51dude-0.3.1/usbtiny.c:44:9: [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. #define usleep(useconds) Sleep(useconds / 1000) ANALYSIS SUMMARY: Hits = 33 Lines analyzed = 1667 in approximately 0.07 seconds (23045 lines/second) Physical Source Lines of Code (SLOC) = 1062 Hits@level = [0] 60 [1] 13 [2] 18 [3] 1 [4] 1 [5] 0 Hits@level+ = [0+] 93 [1+] 33 [2+] 20 [3+] 2 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 87.5706 [1+] 31.0734 [2+] 18.8324 [3+] 1.88324 [4+] 0.94162 [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.