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/m2vrequantiser-1.1/getvlc.h Examining data/m2vrequantiser-1.1/putvlc.h Examining data/m2vrequantiser-1.1/qTable.h Examining data/m2vrequantiser-1.1/main.c FINAL RESULTS: data/m2vrequantiser-1.1/main.c:243:19: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define DEB(msg) fprintf (stderr, "%s:%d " msg, __FILE__, __LINE__) data/m2vrequantiser-1.1/main.c:244:32: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define DEBF(format, args...) fprintf (stderr, "%s:%d " format, __FILE__, __LINE__, args) data/m2vrequantiser-1.1/main.c:254:18: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define LOG(msg) fprintf (stderr, msg) data/m2vrequantiser-1.1/main.c:256:29: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define LOGF(format, arg1) fprintf (stderr, format, arg1) data/m2vrequantiser-1.1/main.c:258:32: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define LOGF(format, args...) fprintf (stderr, format, args) data/m2vrequantiser-1.1/main.c:2215:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr,\ data/m2vrequantiser-1.1/main.c:2221:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr,\ data/m2vrequantiser-1.1/main.c:2229:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr,\ data/m2vrequantiser-1.1/main.c:2235:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr,\ data/m2vrequantiser-1.1/main.c:377: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(wbuf, cbuf, x);\ data/m2vrequantiser-1.1/main.c:1978: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(tempBuf, savedWbuf, bytesToCopy); data/m2vrequantiser-1.1/main.c:2262: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 logFileName[256]; data/m2vrequantiser-1.1/main.c:2265:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(logFileName, "Logfile_%03i.txt", suffix); data/m2vrequantiser-1.1/main.c:2266:15: [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). LOG_FILE = fopen(logFileName, "r"); data/m2vrequantiser-1.1/main.c:2269:14: [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). LOG_FILE = fopen(logFileName, "w"); data/m2vrequantiser-1.1/main.c:2283:8: [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). ifd = fopen(argv[argc - 2], "rb"); data/m2vrequantiser-1.1/main.c:2284:8: [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). ofd = fopen(argv[argc - 1], "wb"); data/m2vrequantiser-1.1/main.c:2316:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). delta_bright = atoi(argv[4]); data/m2vrequantiser-1.1/main.c:2327:12: [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. unsigned char buf[4096]; data/m2vrequantiser-1.1/main.c:2685: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(outTemp, inTemp, cbuf - inTemp); data/m2vrequantiser-1.1/main.c:316:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). mloka1 = read(0, rbuf, mloka2); \ data/m2vrequantiser-1.1/main.c:2331:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int i = read(0, buf, 4096); data/m2vrequantiser-1.1/main.c:2618:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). mloka1 = read(0, rbuf, mloka2); ANALYSIS SUMMARY: Hits = 23 Lines analyzed = 4535 in approximately 0.15 seconds (30170 lines/second) Physical Source Lines of Code (SLOC) = 3832 Hits@level = [0] 7 [1] 3 [2] 11 [3] 0 [4] 9 [5] 0 Hits@level+ = [0+] 30 [1+] 23 [2+] 20 [3+] 9 [4+] 9 [5+] 0 Hits/KSLOC@level+ = [0+] 7.82881 [1+] 6.00209 [2+] 5.21921 [3+] 2.34864 [4+] 2.34864 [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.