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/pdlzip-1.10/LzmaEnc.c Examining data/pdlzip-1.10/LzmaEnc.h Examining data/pdlzip-1.10/LzmaDec.h Examining data/pdlzip-1.10/carg_parser.c Examining data/pdlzip-1.10/carg_parser.h Examining data/pdlzip-1.10/LzFind.h Examining data/pdlzip-1.10/main.c Examining data/pdlzip-1.10/LzFind.c Examining data/pdlzip-1.10/LzmaDec.c Examining data/pdlzip-1.10/lzip.h FINAL RESULTS: data/pdlzip-1.10/main.c:300: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/pdlzip-1.10/main.c:302: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/pdlzip-1.10/main.c:317: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/pdlzip-1.10/main.c:318: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/pdlzip-1.10/main.c:323: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/pdlzip-1.10/main.c:1073: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/pdlzip-1.10/LzmaDec.c:756: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(p->tempBuf, src, inSize); data/pdlzip-1.10/LzmaDec.c:846: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(dest, p->dic + dicPos, outSizeCur); data/pdlzip-1.10/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/pdlzip-1.10/lzip.h:164: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/pdlzip-1.10/main.c:203: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/pdlzip-1.10/main.c:324: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/pdlzip-1.10/main.c:344: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). infd = open( name, O_RDONLY | O_BINARY ); data/pdlzip-1.10/main.c:379: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/pdlzip-1.10/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/pdlzip-1.10/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/pdlzip-1.10/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/pdlzip-1.10/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/pdlzip-1.10/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/pdlzip-1.10/lzip.h:80: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/pdlzip-1.10/lzip.h:84: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/pdlzip-1.10/lzip.h:98: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/pdlzip-1.10/main.c:219: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/pdlzip-1.10/main.c:255: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/pdlzip-1.10/main.c:259: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/pdlzip-1.10/main.c:286: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/pdlzip-1.10/main.c:287: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/pdlzip-1.10/main.c:298: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 ) + data/pdlzip-1.10/main.c:299: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/pdlzip-1.10/main.c:308: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/pdlzip-1.10/main.c:312: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/pdlzip-1.10/main.c:316: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/pdlzip-1.10/main.c:852: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/pdlzip-1.10/main.c:1072: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 = 34 Lines analyzed = 5218 in approximately 0.14 seconds (38171 lines/second) Physical Source Lines of Code (SLOC) = 4405 Hits@level = [0] 35 [1] 20 [2] 8 [3] 0 [4] 6 [5] 0 Hits@level+ = [0+] 69 [1+] 34 [2+] 14 [3+] 6 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 15.664 [1+] 7.7185 [2+] 3.17821 [3+] 1.36209 [4+] 1.36209 [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.