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/parchive-1.1/checkpar.c Examining data/parchive-1.1/checkpar.h Examining data/parchive-1.1/md5.c Examining data/parchive-1.1/interface.c Examining data/parchive-1.1/interface.h Examining data/parchive-1.1/makepar.c Examining data/parchive-1.1/makepar.h Examining data/parchive-1.1/md5.h Examining data/parchive-1.1/par.h Examining data/parchive-1.1/readoldpar.c Examining data/parchive-1.1/readoldpar.h Examining data/parchive-1.1/rs.c Examining data/parchive-1.1/rs.h Examining data/parchive-1.1/fileops.c Examining data/parchive-1.1/types.h Examining data/parchive-1.1/ui_text.c Examining data/parchive-1.1/util.h Examining data/parchive-1.1/fileops.h Examining data/parchive-1.1/rwpar.h Examining data/parchive-1.1/backend.c Examining data/parchive-1.1/backend.h Examining data/parchive-1.1/ui_cli.c Examining data/parchive-1.1/main.c Examining data/parchive-1.1/rwpar.c FINAL RESULTS: data/parchive-1.1/fileops.c:151:2: [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(d, s); data/parchive-1.1/fileops.c:216:2: [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(f->name, path); data/parchive-1.1/fileops.c:268:6: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (realpath(path, buf)) data/parchive-1.1/fileops.c:106: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. static char buf[33]; data/parchive-1.1/fileops.c:186:7: [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). i = open(f->name, f->wr ? O_RDWR|O_CREAT|O_EXCL : O_RDONLY, data/parchive-1.1/fileops.c:243:6: [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). f = fopen(stuni(file), "rb"); data/parchive-1.1/fileops.c:295: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(dr, dir, l); data/parchive-1.1/fileops.c:352:6: [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). f = fopen(stuni(file), "rb"); data/parchive-1.1/md5.c:38:23: [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 const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; data/parchive-1.1/md5.c:111: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 (&ctx->buffer[bytes], fillbuf, pad); data/parchive-1.1/md5.c:142: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 buffer[BLOCKSIZE + 72]; data/parchive-1.1/md5.c:229: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 (&ctx->buffer[left_over], buffer, add); data/parchive-1.1/md5.c:236: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 (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], data/parchive-1.1/md5.c:256: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 (ctx->buffer, buffer, len); data/parchive-1.1/md5.h:45: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 buffer[128]; data/parchive-1.1/rwpar.c:124: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(p, par, PAR_FIX_HEAD_SIZE); data/parchive-1.1/util.h:14:30: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define COPY(tgt, src, nel) (memcpy((tgt), (src), ((nel) * sizeof(*(tgt))))) data/parchive-1.1/backend.c:185:10: [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). l = i + strlen(ext); data/parchive-1.1/fileops.c:43: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). NEW(uni, strlen(str) +1); data/parchive-1.1/fileops.c:150: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). NEW(d, strlen(s) + 1); data/parchive-1.1/fileops.c:215:15: [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). NEW(f->name, strlen(path) + 1); data/parchive-1.1/fileops.c:302:15: [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). NEW(p, l + strlen(de->d_name) + 1); data/parchive-1.1/ui_text.c:143:9: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cc = getchar(); data/parchive-1.1/ui_text.c:153:9: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cc = getchar(); data/parchive-1.1/ui_text.c:193:8: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cc = getchar(); data/parchive-1.1/ui_text.c:197:8: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cc = getchar(); data/parchive-1.1/ui_text.c:211:8: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cc = getchar(); data/parchive-1.1/ui_text.c:216:8: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cc = getchar(); data/parchive-1.1/ui_text.c:220:8: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cc = getchar(); data/parchive-1.1/ui_text.c:230:8: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cc = getchar(); ANALYSIS SUMMARY: Hits = 30 Lines analyzed = 5176 in approximately 0.15 seconds (34193 lines/second) Physical Source Lines of Code (SLOC) = 3895 Hits@level = [0] 128 [1] 13 [2] 14 [3] 1 [4] 2 [5] 0 Hits@level+ = [0+] 158 [1+] 30 [2+] 17 [3+] 3 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 40.5648 [1+] 7.70218 [2+] 4.36457 [3+] 0.770218 [4+] 0.513479 [5+] 0 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.