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/clzip-1.11/encoder_base.c Examining data/clzip-1.11/fast_encoder.c Examining data/clzip-1.11/encoder_base.h Examining data/clzip-1.11/fast_encoder.h Examining data/clzip-1.11/carg_parser.c Examining data/clzip-1.11/lzip_index.c Examining data/clzip-1.11/list.c Examining data/clzip-1.11/lzip_index.h Examining data/clzip-1.11/lzip.h Examining data/clzip-1.11/carg_parser.h Examining data/clzip-1.11/encoder.h Examining data/clzip-1.11/decoder.c Examining data/clzip-1.11/main.c Examining data/clzip-1.11/encoder.c Examining data/clzip-1.11/decoder.h FINAL RESULTS: data/clzip-1.11/main.c:324: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/clzip-1.11/main.c:327:5: [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( output_filename, known_extensions[0].from ); data/clzip-1.11/main.c:342: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/clzip-1.11/main.c:343: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/clzip-1.11/main.c:348: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/clzip-1.11/main.c:1011:13: [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/clzip-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/clzip-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/clzip-1.11/decoder.h:278: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/clzip-1.11/lzip.h:233: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( data, lzip_magic, 4 ); data[4] = 1; } data/clzip-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/clzip-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/clzip-1.11/main.c:197: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/clzip-1.11/main.c:207: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/clzip-1.11/main.c:208: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/clzip-1.11/main.c:325:19: [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. if( multifile ) strcat( output_filename, "00001" ); data/clzip-1.11/main.c:349: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/clzip-1.11/main.c:359: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/clzip-1.11/main.c:408: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/clzip-1.11/main.c:634: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/clzip-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/clzip-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/clzip-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/clzip-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/clzip-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/clzip-1.11/decoder.c:41: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/clzip-1.11/lzip.h:146: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/clzip-1.11/lzip.h:150: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/clzip-1.11/lzip.h:164: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/clzip-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/clzip-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/clzip-1.11/main.c:231:60: [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 long ulimit ) data/clzip-1.11/main.c:267: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/clzip-1.11/main.c:271: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/clzip-1.11/main.c:309: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/clzip-1.11/main.c:310: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/clzip-1.11/main.c:322:53: [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). output_filename = resize_buffer( output_filename, strlen( name ) + 5 + data/clzip-1.11/main.c:323:36: [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[0].from ) + 1 ); data/clzip-1.11/main.c:333: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/clzip-1.11/main.c:337: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/clzip-1.11/main.c:341: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/clzip-1.11/main.c:511: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( output_filename ); data/clzip-1.11/main.c:512:28: [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( known_extensions[0].from ); data/clzip-1.11/main.c:1010:33: [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 = 44 Lines analyzed = 4872 in approximately 0.41 seconds (11864 lines/second) Physical Source Lines of Code (SLOC) = 3986 Hits@level = [0] 40 [1] 24 [2] 14 [3] 0 [4] 6 [5] 0 Hits@level+ = [0+] 84 [1+] 44 [2+] 20 [3+] 6 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 21.0738 [1+] 11.0386 [2+] 5.01756 [3+] 1.50527 [4+] 1.50527 [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.