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/lunzip-1.11/decoder.c Examining data/lunzip-1.11/lzip_index.h Examining data/lunzip-1.11/carg_parser.c Examining data/lunzip-1.11/carg_parser.h Examining data/lunzip-1.11/lzip_index.c Examining data/lunzip-1.11/main.c Examining data/lunzip-1.11/list.c Examining data/lunzip-1.11/decoder.h Examining data/lunzip-1.11/lzip.h FINAL RESULTS: data/lunzip-1.11/main.c:312:7: [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( output_filename, name ); data/lunzip-1.11/main.c:313:7: [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( output_filename + name_len - from_len, known_extensions[eindex].to ); data/lunzip-1.11/main.c:318: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( output_filename, name ); data/lunzip-1.11/main.c:773:11: [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( output_filename, default_output_filename ); data/lunzip-1.11/carg_parser.c:160:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char code_str[2]; data/lunzip-1.11/decoder.h:75: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( outbuf + sz, rdec->buffer + rdec->pos, rd ); data/lunzip-1.11/decoder.h:288: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( d->buffer + lpos, d->buffer + i, len ); data/lunzip-1.11/lzip_index.c:102: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[80]; data/lunzip-1.11/lzip_index.c:174:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( buffer + rd_size, buffer, buffer_size - rd_size ); data/lunzip-1.11/main.c:179: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 buf[80]; data/lunzip-1.11/main.c:189: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 buf[bufsize]; data/lunzip-1.11/main.c:190: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 * const prefix[8] = data/lunzip-1.11/main.c:319:3: [2] (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). Risk is low because the source is a constant string. strcat( output_filename, ".out" ); data/lunzip-1.11/main.c:329:14: [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). int infd = open( name, O_RDONLY | O_BINARY ); data/lunzip-1.11/main.c:362:11: [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). outfd = open( output_filename, flags, outfd_mode ); data/lunzip-1.11/main.c:459:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[80]; data/lunzip-1.11/carg_parser.c:38: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). const int len = strlen( argument ); data/lunzip-1.11/carg_parser.c:50:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( p->argument, argument, len + 1 ); data/lunzip-1.11/carg_parser.c:58: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). const int len = strlen( msg ); data/lunzip-1.11/carg_parser.c:62:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( ap->error + ap->error_size, msg, len + 1 ); data/lunzip-1.11/carg_parser.c:92: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( options[i].name ) == len ) /* Exact match found */ data/lunzip-1.11/decoder.c:44:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). const int n = read( fd, buf + sz, size - sz ); data/lunzip-1.11/lzip.h:144:20: [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). stdin_name_len = strlen( pp->stdin_name ); data/lunzip-1.11/lzip.h:148:69: [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). const unsigned len = (strcmp( s, "-" ) == 0) ? stdin_name_len : strlen( s ); data/lunzip-1.11/lzip.h:162: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). name_len = strlen( pp->name ); data/lunzip-1.11/lzip_index.c:43: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). const int len = strlen( msg ); data/lunzip-1.11/lzip_index.c:47:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( li->error + li->error_size, msg, len + 1 ); data/lunzip-1.11/main.c:213:50: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. const unsigned long ulimit ) data/lunzip-1.11/main.c:249:11: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. if( ulimit / factor >= result ) result *= factor; data/lunzip-1.11/main.c:253:47: [1] (obsolete) ulimit: This C routine is considered obsolete (as opposed to the shell command by the same name, which is NOT obsolete) (CWE-676). Use getrlimit(2), setrlimit(2), and sysconf(3) instead. if( !errno && ( result < llimit || result > ulimit ) ) errno = ERANGE; data/lunzip-1.11/main.c:291:31: [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). const unsigned name_len = strlen( name ); data/lunzip-1.11/main.c:292: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). const unsigned ext_len = strlen( ext ); data/lunzip-1.11/main.c:303: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). const unsigned name_len = strlen( name ); data/lunzip-1.11/main.c:307:31: [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). const unsigned from_len = strlen( from ); data/lunzip-1.11/main.c:311: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). strlen( known_extensions[eindex].to ) + 1 ); data/lunzip-1.11/main.c:772:31: [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). strlen( default_output_filename ) + 1 ); ANALYSIS SUMMARY: Hits = 36 Lines analyzed = 2737 in approximately 0.09 seconds (29956 lines/second) Physical Source Lines of Code (SLOC) = 2209 Hits@level = [0] 37 [1] 20 [2] 12 [3] 0 [4] 4 [5] 0 Hits@level+ = [0+] 73 [1+] 36 [2+] 16 [3+] 4 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 33.0466 [1+] 16.297 [2+] 7.2431 [3+] 1.81077 [4+] 1.81077 [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.