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/advancecomp-2.1/7z/7z.h Examining data/advancecomp-2.1/7z/7zdeflate.cc Examining data/advancecomp-2.1/7z/7zlzma.cc Examining data/advancecomp-2.1/7z/AriBitCoder.cc Examining data/advancecomp-2.1/7z/AriBitCoder.h Examining data/advancecomp-2.1/7z/AriConst.h Examining data/advancecomp-2.1/7z/AriPrice.h Examining data/advancecomp-2.1/7z/BinTree.h Examining data/advancecomp-2.1/7z/BinTree2.h Examining data/advancecomp-2.1/7z/BinTree2Main.h Examining data/advancecomp-2.1/7z/BinTree3.h Examining data/advancecomp-2.1/7z/BinTree3Main.h Examining data/advancecomp-2.1/7z/BinTree3Z.h Examining data/advancecomp-2.1/7z/BinTree3ZMain.h Examining data/advancecomp-2.1/7z/BinTree4.h Examining data/advancecomp-2.1/7z/BinTree4Main.h Examining data/advancecomp-2.1/7z/BinTree4b.h Examining data/advancecomp-2.1/7z/BinTree4bMain.h Examining data/advancecomp-2.1/7z/BinTreeMF.h Examining data/advancecomp-2.1/7z/BinTreeMFMain.h Examining data/advancecomp-2.1/7z/BinTreeMain.h Examining data/advancecomp-2.1/7z/BitTreeCoder.h Examining data/advancecomp-2.1/7z/CRC.cc Examining data/advancecomp-2.1/7z/CRC.h Examining data/advancecomp-2.1/7z/Const.h Examining data/advancecomp-2.1/7z/DeflateDecoder.cc Examining data/advancecomp-2.1/7z/DeflateDecoder.h Examining data/advancecomp-2.1/7z/DeflateEncoder.cc Examining data/advancecomp-2.1/7z/DeflateEncoder.h Examining data/advancecomp-2.1/7z/HuffmanDecoder.h Examining data/advancecomp-2.1/7z/HuffmanEncoder.cc Examining data/advancecomp-2.1/7z/HuffmanEncoder.h Examining data/advancecomp-2.1/7z/IInOutStreams.cc Examining data/advancecomp-2.1/7z/IInOutStreams.h Examining data/advancecomp-2.1/7z/InByte.cc Examining data/advancecomp-2.1/7z/InByte.h Examining data/advancecomp-2.1/7z/LSBFDecoder.cc Examining data/advancecomp-2.1/7z/LSBFDecoder.h Examining data/advancecomp-2.1/7z/LSBFEncoder.cc Examining data/advancecomp-2.1/7z/LSBFEncoder.h Examining data/advancecomp-2.1/7z/LZMA.cc Examining data/advancecomp-2.1/7z/LZMA.h Examining data/advancecomp-2.1/7z/LZMADecoder.cc Examining data/advancecomp-2.1/7z/LZMADecoder.h Examining data/advancecomp-2.1/7z/LZMAEncoder.cc Examining data/advancecomp-2.1/7z/LZMAEncoder.h Examining data/advancecomp-2.1/7z/LenCoder.cc Examining data/advancecomp-2.1/7z/LenCoder.h Examining data/advancecomp-2.1/7z/LiteralCoder.cc Examining data/advancecomp-2.1/7z/LiteralCoder.h Examining data/advancecomp-2.1/7z/OutByte.cc Examining data/advancecomp-2.1/7z/OutByte.h Examining data/advancecomp-2.1/7z/Portable.h Examining data/advancecomp-2.1/7z/RCDefs.h Examining data/advancecomp-2.1/7z/RangeCoder.h Examining data/advancecomp-2.1/7z/WindowIn.cc Examining data/advancecomp-2.1/7z/WindowIn.h Examining data/advancecomp-2.1/7z/WindowOut.cc Examining data/advancecomp-2.1/7z/WindowOut.h Examining data/advancecomp-2.1/compress.cc Examining data/advancecomp-2.1/compress.h Examining data/advancecomp-2.1/data.cc Examining data/advancecomp-2.1/data.h Examining data/advancecomp-2.1/except.h Examining data/advancecomp-2.1/file.cc Examining data/advancecomp-2.1/file.h Examining data/advancecomp-2.1/getopt.c Examining data/advancecomp-2.1/lib/endianrw.h Examining data/advancecomp-2.1/lib/error.c Examining data/advancecomp-2.1/lib/error.h Examining data/advancecomp-2.1/lib/extra.h Examining data/advancecomp-2.1/lib/fz.c Examining data/advancecomp-2.1/lib/fz.h Examining data/advancecomp-2.1/lib/mng.c Examining data/advancecomp-2.1/lib/mng.h Examining data/advancecomp-2.1/lib/png.h Examining data/advancecomp-2.1/lib/snstring.c Examining data/advancecomp-2.1/lib/snstring.h Examining data/advancecomp-2.1/lib/png.c Examining data/advancecomp-2.1/libdeflate/adler32.c Examining data/advancecomp-2.1/libdeflate/adler32_impl.h Examining data/advancecomp-2.1/libdeflate/aligned_malloc.c Examining data/advancecomp-2.1/libdeflate/aligned_malloc.h Examining data/advancecomp-2.1/libdeflate/bt_matchfinder.h Examining data/advancecomp-2.1/libdeflate/common_defs.h Examining data/advancecomp-2.1/libdeflate/compiler_gcc.h Examining data/advancecomp-2.1/libdeflate/crc32.c Examining data/advancecomp-2.1/libdeflate/crc32_impl.h Examining data/advancecomp-2.1/libdeflate/crc32_table.h Examining data/advancecomp-2.1/libdeflate/decompress_impl.h Examining data/advancecomp-2.1/libdeflate/deflate_compress.c Examining data/advancecomp-2.1/libdeflate/deflate_compress.h Examining data/advancecomp-2.1/libdeflate/deflate_constants.h Examining data/advancecomp-2.1/libdeflate/deflate_decompress.c Examining data/advancecomp-2.1/libdeflate/gzip_compress.c Examining data/advancecomp-2.1/libdeflate/gzip_constants.h Examining data/advancecomp-2.1/libdeflate/gzip_decompress.c Examining data/advancecomp-2.1/libdeflate/hc_matchfinder.h Examining data/advancecomp-2.1/libdeflate/lib_common.h Examining data/advancecomp-2.1/libdeflate/libdeflate.h Examining data/advancecomp-2.1/libdeflate/matchfinder_avx2.h Examining data/advancecomp-2.1/libdeflate/matchfinder_common.h Examining data/advancecomp-2.1/libdeflate/matchfinder_neon.h Examining data/advancecomp-2.1/libdeflate/matchfinder_sse2.h Examining data/advancecomp-2.1/libdeflate/unaligned.h Examining data/advancecomp-2.1/libdeflate/x86_cpu_features.c Examining data/advancecomp-2.1/libdeflate/x86_cpu_features.h Examining data/advancecomp-2.1/libdeflate/zlib_compress.c Examining data/advancecomp-2.1/libdeflate/zlib_constants.h Examining data/advancecomp-2.1/libdeflate/zlib_decompress.c Examining data/advancecomp-2.1/mngex.cc Examining data/advancecomp-2.1/mngex.h Examining data/advancecomp-2.1/pngex.h Examining data/advancecomp-2.1/portable.c Examining data/advancecomp-2.1/portable.h Examining data/advancecomp-2.1/redef.cc Examining data/advancecomp-2.1/remng.cc Examining data/advancecomp-2.1/repng.cc Examining data/advancecomp-2.1/rezip.cc Examining data/advancecomp-2.1/scroll.cc Examining data/advancecomp-2.1/scroll.h Examining data/advancecomp-2.1/siglock.cc Examining data/advancecomp-2.1/siglock.h Examining data/advancecomp-2.1/snprintf.c Examining data/advancecomp-2.1/zip.cc Examining data/advancecomp-2.1/zip.h Examining data/advancecomp-2.1/zipsh.cc Examining data/advancecomp-2.1/zopfli/blocksplitter.c Examining data/advancecomp-2.1/zopfli/blocksplitter.h Examining data/advancecomp-2.1/zopfli/cache.c Examining data/advancecomp-2.1/zopfli/cache.h Examining data/advancecomp-2.1/zopfli/deflate.c Examining data/advancecomp-2.1/zopfli/deflate.h Examining data/advancecomp-2.1/zopfli/gzip_container.c Examining data/advancecomp-2.1/zopfli/gzip_container.h Examining data/advancecomp-2.1/zopfli/hash.c Examining data/advancecomp-2.1/zopfli/hash.h Examining data/advancecomp-2.1/zopfli/katajainen.c Examining data/advancecomp-2.1/zopfli/katajainen.h Examining data/advancecomp-2.1/zopfli/lz77.c Examining data/advancecomp-2.1/zopfli/lz77.h Examining data/advancecomp-2.1/zopfli/squeeze.c Examining data/advancecomp-2.1/zopfli/squeeze.h Examining data/advancecomp-2.1/zopfli/symbols.h Examining data/advancecomp-2.1/zopfli/tree.c Examining data/advancecomp-2.1/zopfli/tree.h Examining data/advancecomp-2.1/zopfli/util.c Examining data/advancecomp-2.1/zopfli/util.h Examining data/advancecomp-2.1/zopfli/zlib_container.c Examining data/advancecomp-2.1/zopfli/zlib_container.h Examining data/advancecomp-2.1/zopfli/zopfli.h Examining data/advancecomp-2.1/zopfli/zopfli_bin.c Examining data/advancecomp-2.1/zopfli/zopfli_lib.c Examining data/advancecomp-2.1/pngex.cc FINAL RESULTS: data/advancecomp-2.1/lib/error.c:129:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(p, size, text, arg); data/advancecomp-2.1/lib/error.c:156:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(error_desc_buffer, sizeof(error_desc_buffer), text, arg); data/advancecomp-2.1/lib/error.c:206:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(p, size, text, arg); data/advancecomp-2.1/lib/error.h:54:62: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void error_set(const char* error, ...) __attribute__((format(printf, 1, 2))); data/advancecomp-2.1/lib/error.h:55:74: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void error_unsupported_set(const char* error, ...) __attribute__((format(printf, 1, 2))); data/advancecomp-2.1/lib/error.h:56:68: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void error_nolog_set(const char* error, ...) __attribute__((format(printf, 1, 2))); data/advancecomp-2.1/lib/snstring.c:121:3: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(str + l, count - l, fmt, arg); data/advancecomp-2.1/lib/snstring.h:52:82: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void sncatf(char* str, size_t count, const char *fmt, ...) __attribute__((format(printf, 3, 4))); data/advancecomp-2.1/portable.h:133:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. int snprintf(char *str, size_t count, const char *fmt, ...); data/advancecomp-2.1/portable.h:144:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. int vsnprintf(char *str, size_t count, const char *fmt, va_list arg); data/advancecomp-2.1/snprintf.c:100:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. int snprintf (char *str, size_t count, const char *fmt, ...); data/advancecomp-2.1/snprintf.c:101:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. int vsnprintf (char *str, size_t count, const char *fmt, va_list arg); data/advancecomp-2.1/snprintf.c:736:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. int vsnprintf (char *str, size_t count, const char *fmt, va_list args) data/advancecomp-2.1/snprintf.c:747:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. int snprintf (char *str, size_t count, const char *fmt, ...) data/advancecomp-2.1/snprintf.c:749:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. int snprintf (va_alist) va_dcl data/advancecomp-2.1/snprintf.c:763:10: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. (void) vsnprintf(str, count, fmt, ap); data/advancecomp-2.1/snprintf.c:817:7: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (buf1, sizeof (buf1), fp_fmt[x], fp_nums[y]); data/advancecomp-2.1/snprintf.c:818:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buf2, fp_fmt[x], fp_nums[y]); data/advancecomp-2.1/snprintf.c:831:7: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (buf1, sizeof (buf1), int_fmt[x], int_nums[y]); data/advancecomp-2.1/snprintf.c:832:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buf2, int_fmt[x], int_nums[y]); data/advancecomp-2.1/zip.cc:1141:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(path.c_str(), F_OK) == 0) { data/advancecomp-2.1/zip.cc:1158:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(path.c_str(), F_OK) == 0) { data/advancecomp-2.1/zopfli/zopfli_bin.c:138: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(result, str1); data/advancecomp-2.1/zopfli/zopfli_bin.c:139:3: [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(result, str2); data/advancecomp-2.1/getopt.c:47:5: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int getopt(int nargc, char *const nargv[], const char *ostr) data/advancecomp-2.1/portable.h:92:5: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int getopt(int argc, char * const *argv, const char *options); data/advancecomp-2.1/redef.cc:691:3: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long(argc, argv, OPTIONS, long_options, 0)) data/advancecomp-2.1/redef.cc:693:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt(argc, argv, OPTIONS)) data/advancecomp-2.1/remng.cc:1119:3: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long(argc, argv, OPTIONS, long_options, 0)) data/advancecomp-2.1/remng.cc:1121:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt(argc, argv, OPTIONS)) data/advancecomp-2.1/repng.cc:412:3: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long(argc, argv, OPTIONS, long_options, 0)) data/advancecomp-2.1/repng.cc:414:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt(argc, argv, OPTIONS)) data/advancecomp-2.1/rezip.cc:514:3: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long(argc, argv, OPTIONS, long_options, 0)) data/advancecomp-2.1/rezip.cc:516:3: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt(argc, argv, OPTIONS)) data/advancecomp-2.1/7z/DeflateEncoder.cc:561: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(m_LastLevels, aNewLevels, kMaxTableSize); data/advancecomp-2.1/7z/DeflateEncoder.cc:624: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(m_LastLevels, aNewLevels, kMaxTableSize); data/advancecomp-2.1/7z/IInOutStreams.cc:8: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(aData, data, aSize); data/advancecomp-2.1/7z/IInOutStreams.cc:20: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(data, aData, aSize); data/advancecomp-2.1/compress.cc:251: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(out_data, data, size); data/advancecomp-2.1/compress.cc:279: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(out_data, data, size); data/advancecomp-2.1/compress.cc:313: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(out_data, data, size); data/advancecomp-2.1/compress.cc:340: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(out_data, data, size); data/advancecomp-2.1/compress.cc:366: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(out_data, data, size); data/advancecomp-2.1/compress.cc:398: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(out_data, data, size); data/advancecomp-2.1/compress.cc:423: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(out_data, data, size); data/advancecomp-2.1/data.cc:39: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(data, Adata, Asize); data/advancecomp-2.1/file.cc:119:12: [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). FILE* f = fopen(path.c_str(), "wb"); data/advancecomp-2.1/file.cc:147:12: [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). FILE* f = fopen(path.c_str(), "rb"); data/advancecomp-2.1/lib/error.c:53:8: [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 error_desc_buffer[ERROR_DESC_MAX]; data/advancecomp-2.1/lib/error.c:68:8: [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 error_cat_prefix_buffer[ERROR_DESC_MAX]; data/advancecomp-2.1/lib/fz.c:48: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(name, mode); data/advancecomp-2.1/lib/fz.c:145: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(buffer, f->data_read + f->virtual_pos, total_size); data/advancecomp-2.1/lib/fz.c:149: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(buffer, f->data_write + f->virtual_pos, total_size); data/advancecomp-2.1/lib/fz.c:205: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(f->data_write + f->virtual_pos, buffer, total_size); data/advancecomp-2.1/lib/fz.c:317:11: [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[ZIP_LO_FIXED]; data/advancecomp-2.1/lib/fz.c:404:11: [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[ZIP_LO_FIXED]; data/advancecomp-2.1/lib/fz.c:678:14: [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 buffer[256]; data/advancecomp-2.1/lib/fz.c:696:11: [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 p[1]; data/advancecomp-2.1/lib/fz.c:707:11: [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 p[2]; data/advancecomp-2.1/lib/fz.c:718:11: [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 p[4]; data/advancecomp-2.1/lib/mng.c:50:11: [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 signature[8]; data/advancecomp-2.1/lib/mng.c:163: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(mng->pal_ptr, data, size); data/advancecomp-2.1/lib/mng.c:390: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(p0, p1, bytes_per_run); data/advancecomp-2.1/lib/mng.c:489: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(mng->pal_ptr, data, size); data/advancecomp-2.1/lib/mng.c:523: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(mng->pal_ptr + v0 * 3, data + i, delta_size); data/advancecomp-2.1/lib/mng.c:596: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(*pal_ptr, mng->pal_ptr, mng->pal_size); data/advancecomp-2.1/lib/mng.c:697: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 buf[4]; data/advancecomp-2.1/lib/mng.h:80:11: [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 pal_ptr[256*3]; /**< Palette data. */ data/advancecomp-2.1/lib/png.c:51:11: [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 cl[4]; data/advancecomp-2.1/lib/png.c:52:11: [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 ct[4]; data/advancecomp-2.1/lib/png.c:53:11: [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 cc[4]; data/advancecomp-2.1/lib/png.c:106:11: [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 v[4]; data/advancecomp-2.1/lib/png.c:149:11: [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 signature[8]; data/advancecomp-2.1/lib/png.c:542: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[4]; data/advancecomp-2.1/lib/png.c:564:4: [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[4]; data/advancecomp-2.1/lib/png.c:705: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[4]; data/advancecomp-2.1/lib/png.c:887: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 buf[4]; data/advancecomp-2.1/libdeflate/common_defs.h:262: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, &v, sizeof(v)); \ data/advancecomp-2.1/libdeflate/decompress_impl.h:213: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(out_next, in_next, len); data/advancecomp-2.1/libdeflate/deflate_compress.c:1677: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(os->next, data, len); data/advancecomp-2.1/mngex.cc:35:11: [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 col_ptr[256*3]; data/advancecomp-2.1/mngex.cc:70: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(ovr_ptr, mng->pal_ptr, 256*3); data/advancecomp-2.1/mngex.cc:150:11: [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 mhdr[28]; data/advancecomp-2.1/mngex.cc:298: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(mng->pal_ptr, pal_ptr, pal_size); data/advancecomp-2.1/mngex.cc:305: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(&mng->current_ptr[i * mng->line], &img_ptr[i * img_scanline], mng->width * mng->pixel); data/advancecomp-2.1/mngex.cc:311:11: [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 defi[12]; data/advancecomp-2.1/mngex.cc:313:11: [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 ihdr[13]; data/advancecomp-2.1/mngex.cc:368:11: [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 move[13]; data/advancecomp-2.1/mngex.cc:395:11: [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 dhdr[20]; data/advancecomp-2.1/mngex.cc:499:11: [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 ihdr[13]; data/advancecomp-2.1/mngex.cc:632:13: [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 ovr_ptr[256*3]; data/advancecomp-2.1/mngex.cc:659:11: [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 fram[10]; data/advancecomp-2.1/mngex.h:52:11: [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 pal_ptr[256*3]; /**< Palette. */ data/advancecomp-2.1/pngex.cc:55: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(p0, p1, dx * img_pixel); data/advancecomp-2.1/pngex.cc:156:2: [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 tag[5]; data/advancecomp-2.1/pngex.cc:339:11: [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 ihdr[13]; data/advancecomp-2.1/pngex.cc:433: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(p1, p0, *dst_scanline); data/advancecomp-2.1/redef.cc:129:11: [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 block[BLOCK_SIZE]; data/advancecomp-2.1/redef.cc:197: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(res_data + pos, i->data, run); data/advancecomp-2.1/redef.cc:299: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(res_data + pos, i->data, run); data/advancecomp-2.1/redef.cc:387:11: [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 header[10]; data/advancecomp-2.1/redef.cc:404: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 extra_len[2]; data/advancecomp-2.1/redef.cc:459:11: [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 footer[8]; data/advancecomp-2.1/redef.cc:485: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 header[8]; data/advancecomp-2.1/redef.cc:719:21: [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). opt_level.iter = atoi(optarg); data/advancecomp-2.1/remng.cc:246:11: [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 col_ptr[256*3]; data/advancecomp-2.1/remng.cc:1174:21: [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). opt_level.iter = atoi(optarg); data/advancecomp-2.1/repng.cc:42:11: [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 col_ptr[256*3]; data/advancecomp-2.1/repng.cc:90: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(pal_ptr, col_ptr, col_count * 3); data/advancecomp-2.1/repng.cc:103: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 new_pal_ptr[256*3]; data/advancecomp-2.1/repng.cc:105: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 new_rns_ptr[256]; data/advancecomp-2.1/repng.cc:451:21: [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). opt_level.iter = atoi(optarg); data/advancecomp-2.1/rezip.cc:48:5: [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). z.open(); data/advancecomp-2.1/rezip.cc:122:5: [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). z.open(); data/advancecomp-2.1/rezip.cc:277:5: [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). z.open(); data/advancecomp-2.1/rezip.cc:301:4: [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). z.open(); data/advancecomp-2.1/rezip.cc:320: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). FILE* f = fopen(file.c_str(), "wb"); data/advancecomp-2.1/rezip.cc:381: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). FILE* f = fopen(file.c_str(), "rb"); data/advancecomp-2.1/rezip.cc:576: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). level.iter = atoi(optarg); data/advancecomp-2.1/scroll.cc:40:13: [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 data[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }; data/advancecomp-2.1/scroll.cc:242: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(ptr + i*scanline, pix_ptr + i*pix_scanline, scanline); data/advancecomp-2.1/snprintf.c:444: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 convert[20]; data/advancecomp-2.1/snprintf.c:569: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 iconvert[20]; data/advancecomp-2.1/snprintf.c:570: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 fconvert[20]; data/advancecomp-2.1/snprintf.c:775: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 buf1[LONG_STRING]; data/advancecomp-2.1/snprintf.c:776: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 buf2[LONG_STRING]; data/advancecomp-2.1/zip.cc:117: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, buf + (start_of_cent_dir - buf_pos), size); data/advancecomp-2.1/zip.cc:286:11: [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[ZIP_LO_FIXED]; data/advancecomp-2.1/zip.cc:306: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(outdata, data, compressed_size_get()); data/advancecomp-2.1/zip.cc:308:13: [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). FILE* f = fopen(parentname_get().c_str(), "rb"); data/advancecomp-2.1/zip.cc:450: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(file_name, Aname.c_str(), info.filename_length); data/advancecomp-2.1/zip.cc:602: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 data_desc[ZIP_DO_FIXED]; data/advancecomp-2.1/zip.cc:640:11: [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[ZIP_LO_FIXED]; data/advancecomp-2.1/zip.cc:721: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(file_name, buf, info.filename_length); data/advancecomp-2.1/zip.cc:743:11: [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[ZIP_CO_FIXED]; data/advancecomp-2.1/zip.cc:809:15: [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). assert(!flag.open); data/advancecomp-2.1/zip.cc:821: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). void zip::open() data/advancecomp-2.1/zip.cc:823:15: [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). assert(!flag.open); data/advancecomp-2.1/zip.cc:838:12: [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). FILE* f = fopen(path.c_str(), "rb"); data/advancecomp-2.1/zip.cc:931: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). assert(flag.open && flag.read && !flag.modify); data/advancecomp-2.1/zip.cc:945: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). assert(flag.open); data/advancecomp-2.1/zip.cc:948:2: [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). open(); data/advancecomp-2.1/zip.cc:956: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). assert(flag.open && !flag.read); data/advancecomp-2.1/zip.cc:960:12: [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). FILE* f = fopen(path.c_str(), "rb"); data/advancecomp-2.1/zip.cc:969:13: [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[ZIP_LO_FIXED]; data/advancecomp-2.1/zip.cc:1079: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). assert(flag.open && flag.read); data/advancecomp-2.1/zip.cc:1090:13: [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). FILE* f = fopen(save_path.c_str(), "wb"); data/advancecomp-2.1/zip.cc:1115:13: [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[ZIP_EO_FIXED]; data/advancecomp-2.1/zip.h:248:8: [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). bool open; // zip is opened data/advancecomp-2.1/zip.h:279:45: [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). const_iterator begin() const { assert(flag.open); return map.begin(); } data/advancecomp-2.1/zip.h:280:43: [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). const_iterator end() const { assert(flag.open); return map.end(); } data/advancecomp-2.1/zip.h:281:33: [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). iterator begin() { assert(flag.open); return map.begin(); } data/advancecomp-2.1/zip.h:282:31: [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). iterator end() { assert(flag.open); return map.end(); } data/advancecomp-2.1/zip.h:284:38: [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). unsigned size() const { assert(flag.open); return map.size(); } data/advancecomp-2.1/zip.h:290: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). void open(); data/advancecomp-2.1/zip.h:298:37: [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). bool is_open() const { return flag.open; } data/advancecomp-2.1/zip.h:299:37: [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). bool is_load() const { assert(flag.open); return flag.read; } data/advancecomp-2.1/zip.h:300:39: [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). bool is_modify() const { assert(flag.open && flag.read); return flag.modify; } data/advancecomp-2.1/zipsh.cc:51: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(uncompressed_data, data, uncompressed_size_get()); data/advancecomp-2.1/zopfli/deflate.c:555: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(ll_lengths, ll_lengths2, sizeof(ll_lengths2)); data/advancecomp-2.1/zopfli/deflate.c:556: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(d_lengths, d_lengths2, sizeof(d_lengths2)); data/advancecomp-2.1/zopfli/squeeze.c:54: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(dest->litlens, source->litlens, data/advancecomp-2.1/zopfli/squeeze.c:56: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(dest->dists, source->dists, ZOPFLI_NUM_D * sizeof(dest->dists[0])); data/advancecomp-2.1/zopfli/squeeze.c:58: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(dest->ll_symbols, source->ll_symbols, data/advancecomp-2.1/zopfli/squeeze.c:60: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(dest->d_symbols, source->d_symbols, data/advancecomp-2.1/zopfli/zopfli_bin.c:51:10: [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). file = fopen(filename, "rb"); data/advancecomp-2.1/zopfli/zopfli_bin.c:86:16: [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). FILE* file = fopen(filename, "wb" ); data/advancecomp-2.1/zopfli/zopfli_bin.c:168:31: [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). options.numiterations = atoi(arg + 3); data/advancecomp-2.1/lib/error.c:89:59: [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). while (error_desc_buffer[0] && isspace(error_desc_buffer[strlen(error_desc_buffer)-1])) data/advancecomp-2.1/lib/error.c:90:21: [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). error_desc_buffer[strlen(error_desc_buffer)-1] = 0; data/advancecomp-2.1/lib/error.c:121:27: [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). p = error_desc_buffer + strlen(error_desc_buffer); data/advancecomp-2.1/lib/error.c:122:38: [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). size = sizeof(error_desc_buffer) - strlen(error_desc_buffer); data/advancecomp-2.1/lib/error.c:138:23: [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 (!text[0] || text[strlen(text)-1] != '\n') data/advancecomp-2.1/lib/error.c:198:27: [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). p = error_desc_buffer + strlen(error_desc_buffer); data/advancecomp-2.1/lib/error.c:199:38: [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). size = sizeof(error_desc_buffer) - strlen(error_desc_buffer); data/advancecomp-2.1/lib/fz.c:99:9: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return fgetc(f); data/advancecomp-2.1/portable.h:60:24: [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). #define NAMLEN(dirent) strlen((dirent)->d_name) data/advancecomp-2.1/remng.cc:1152:17: [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 (n < 1 || strlen(optarg) != s) data/advancecomp-2.1/remng.cc:1181:17: [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 (n < 2 || strlen(optarg) != s) data/advancecomp-2.1/remng.cc:1194:17: [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 (n < 1 || strlen(optarg) != s) data/advancecomp-2.1/snprintf.c:740: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). return(strlen(str)); data/advancecomp-2.1/snprintf.c:765: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). return(strlen(str)); data/advancecomp-2.1/zip.cc:931:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(flag.open && flag.read && !flag.modify); data/advancecomp-2.1/zip.cc:956:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(flag.open && !flag.read); data/advancecomp-2.1/zip.cc:1079:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(flag.open && flag.read); data/advancecomp-2.1/zip.cc:1170:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(flag.read); data/advancecomp-2.1/zip.cc:1183:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(flag.read); data/advancecomp-2.1/zip.cc:1197:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(flag.read); data/advancecomp-2.1/zip.cc:1234:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(flag.read); data/advancecomp-2.1/zip.h:249:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read; // zip is loaded (valid only if flag_open==true) data/advancecomp-2.1/zip.h:299:56: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool is_load() const { assert(flag.open); return flag.read; } data/advancecomp-2.1/zip.h:300:52: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool is_modify() const { assert(flag.open && flag.read); return flag.modify; } data/advancecomp-2.1/zipsh.cc:436:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(flag.read); data/advancecomp-2.1/zipsh.cc:444:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(flag.read); data/advancecomp-2.1/zopfli/zopfli_bin.c:135:16: [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). size_t len = strlen(str1) + strlen(str2); data/advancecomp-2.1/zopfli/zopfli_bin.c:135: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). size_t len = strlen(str1) + strlen(str2); ANALYSIS SUMMARY: Hits = 196 Lines analyzed = 33488 in approximately 0.83 seconds (40117 lines/second) Physical Source Lines of Code (SLOC) = 22763 Hits@level = [0] 54 [1] 28 [2] 134 [3] 10 [4] 24 [5] 0 Hits@level+ = [0+] 250 [1+] 196 [2+] 168 [3+] 34 [4+] 24 [5+] 0 Hits/KSLOC@level+ = [0+] 10.9827 [1+] 8.61046 [2+] 7.3804 [3+] 1.49365 [4+] 1.05434 [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.