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/r-cran-jpeg-0.1-8.1/src/read.c Examining data/r-cran-jpeg-0.1-8.1/src/write.c Examining data/r-cran-jpeg-0.1-8.1/src/rjcommon.h Examining data/r-cran-jpeg-0.1-8.1/src/jcompat.h FINAL RESULTS: data/r-cran-jpeg-0.1-8.1/src/read.c:45: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(fn, "rb"); data/r-cran-jpeg-0.1-8.1/src/read.c:71:6: [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 bo[4] = { 1, 0, 0, 0 }; data/r-cran-jpeg-0.1-8.1/src/read.c:73: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(&bi, bo, 4); data/r-cran-jpeg-0.1-8.1/src/read.c:99: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(idata, image, rowbytes * height); data/r-cran-jpeg-0.1-8.1/src/rjcommon.h:35: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 buffer[JMSG_LENGTH_MAX]; data/r-cran-jpeg-0.1-8.1/src/rjcommon.h:44: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 buffer[JMSG_LENGTH_MAX]; data/r-cran-jpeg-0.1-8.1/src/write.c:151: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(fn, "wb"); data/r-cran-jpeg-0.1-8.1/src/write.c:211: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(flat_rows, (char*) INTEGER(image), rowbytes * height); data/r-cran-jpeg-0.1-8.1/src/write.c:259: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(RAW(res), Rjpeg_mem_ptr(cinfo), len); ANALYSIS SUMMARY: Hits = 9 Lines analyzed = 600 in approximately 0.03 seconds (21624 lines/second) Physical Source Lines of Code (SLOC) = 461 Hits@level = [0] 0 [1] 0 [2] 9 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 9 [1+] 9 [2+] 9 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 19.5228 [1+] 19.5228 [2+] 19.5228 [3+] 0 [4+] 0 [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.