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/wreport-3.23/src/output.cc Examining data/wreport-3.23/src/options.cc Examining data/wreport-3.23/src/input.cc Examining data/wreport-3.23/src/makebuoy.cc Examining data/wreport-3.23/src/options.h Examining data/wreport-3.23/src/unparsable.cc Examining data/wreport-3.23/src/info.cc Examining data/wreport-3.23/src/afl-test.cc Examining data/wreport-3.23/src/wrep.cc Examining data/wreport-3.23/src/iterate.cc Examining data/wreport-3.23/src/examples.cc Examining data/wreport-3.23/python/common.cc Examining data/wreport-3.23/python/varinfo.cc Examining data/wreport-3.23/python/vartable.h Examining data/wreport-3.23/python/var.h Examining data/wreport-3.23/python/utils/values.cc Examining data/wreport-3.23/python/utils/type.h Examining data/wreport-3.23/python/utils/dict.h Examining data/wreport-3.23/python/utils/core.cc Examining data/wreport-3.23/python/utils/values.h Examining data/wreport-3.23/python/utils/core.h Examining data/wreport-3.23/python/utils/methods.cc Examining data/wreport-3.23/python/utils/methods.h Examining data/wreport-3.23/python/common.h Examining data/wreport-3.23/python/wreport.cc Examining data/wreport-3.23/python/var.cc Examining data/wreport-3.23/python/varinfo.h Examining data/wreport-3.23/python/vartable.cc Examining data/wreport-3.23/wreport/error.h Examining data/wreport-3.23/wreport/tables.h Examining data/wreport-3.23/wreport/error.cc Examining data/wreport-3.23/wreport/tests-test.cc Examining data/wreport-3.23/wreport/subset.h Examining data/wreport-3.23/wreport/options.cc Examining data/wreport-3.23/wreport/python.h Examining data/wreport-3.23/wreport/subset.cc Examining data/wreport-3.23/wreport/benchmark-main.cc Examining data/wreport-3.23/wreport/tableinfo.h Examining data/wreport-3.23/wreport/vartable-test.cc Examining data/wreport-3.23/wreport/opcodes.h Examining data/wreport-3.23/wreport/bulletin.cc Examining data/wreport-3.23/wreport/benchmark.h Examining data/wreport-3.23/wreport/bufr_encoder.cc Examining data/wreport-3.23/wreport/tests.h Examining data/wreport-3.23/wreport/tableinfo-test.cc Examining data/wreport-3.23/wreport/crex_decoder.cc Examining data/wreport-3.23/wreport/codetables.h Examining data/wreport-3.23/wreport/options-test.cc Examining data/wreport-3.23/wreport/dtable.cc Examining data/wreport-3.23/wreport/varinfo.cc Examining data/wreport-3.23/wreport/bulletin.h Examining data/wreport-3.23/wreport/notes.h Examining data/wreport-3.23/wreport/vartable.h Examining data/wreport-3.23/wreport/bulletin/internals.h Examining data/wreport-3.23/wreport/bulletin/internals-test.cc Examining data/wreport-3.23/wreport/bulletin/bitmaps.h Examining data/wreport-3.23/wreport/bulletin/dds-validator-test.cc Examining data/wreport-3.23/wreport/bulletin/dds-validator.cc Examining data/wreport-3.23/wreport/bulletin/dds-scanfeatures.cc Examining data/wreport-3.23/wreport/bulletin/associated_fields-test.cc Examining data/wreport-3.23/wreport/bulletin/associated_fields.cc Examining data/wreport-3.23/wreport/bulletin/dds-printer.cc Examining data/wreport-3.23/wreport/bulletin/dds-validator.h Examining data/wreport-3.23/wreport/bulletin/interpreter.cc Examining data/wreport-3.23/wreport/bulletin/associated_fields.h Examining data/wreport-3.23/wreport/bulletin/interpreter-test.cc Examining data/wreport-3.23/wreport/bulletin/interpreter.h Examining data/wreport-3.23/wreport/bulletin/dds-scanfeatures.h Examining data/wreport-3.23/wreport/bulletin/dds-printer.h Examining data/wreport-3.23/wreport/bulletin/bitmaps-test.cc Examining data/wreport-3.23/wreport/bulletin/internals.cc Examining data/wreport-3.23/wreport/bulletin/bitmaps.cc Examining data/wreport-3.23/wreport/subset-test.cc Examining data/wreport-3.23/wreport/var-lua.cc Examining data/wreport-3.23/wreport/var.h Examining data/wreport-3.23/wreport/var-bench.cc Examining data/wreport-3.23/wreport/conv.h Examining data/wreport-3.23/wreport/utils/subprocess.cc Examining data/wreport-3.23/wreport/utils/sys.h Examining data/wreport-3.23/wreport/utils/subprocess.h Examining data/wreport-3.23/wreport/utils/tests-main.cc Examining data/wreport-3.23/wreport/utils/tests.h Examining data/wreport-3.23/wreport/utils/string.cc Examining data/wreport-3.23/wreport/utils/testrunner.h Examining data/wreport-3.23/wreport/utils/lua.h Examining data/wreport-3.23/wreport/utils/sys.cc Examining data/wreport-3.23/wreport/utils/string.h Examining data/wreport-3.23/wreport/utils/lua.cc Examining data/wreport-3.23/wreport/utils/term.h Examining data/wreport-3.23/wreport/utils/term.cc Examining data/wreport-3.23/wreport/utils/tests.cc Examining data/wreport-3.23/wreport/utils/testrunner.cc Examining data/wreport-3.23/wreport/bufr_encoder-test.cc Examining data/wreport-3.23/wreport/crex_encoder.cc Examining data/wreport-3.23/wreport/opcodes.cc Examining data/wreport-3.23/wreport/notes.cc Examining data/wreport-3.23/wreport/options.h Examining data/wreport-3.23/wreport/bulletin-bench.cc Examining data/wreport-3.23/wreport/bulletin-test.cc Examining data/wreport-3.23/wreport/conv.cc Examining data/wreport-3.23/wreport/varinfo-test.cc Examining data/wreport-3.23/wreport/error-test.cc Examining data/wreport-3.23/wreport/conv-bench.cc Examining data/wreport-3.23/wreport/conv-test.cc Examining data/wreport-3.23/wreport/internals/compat.h Examining data/wreport-3.23/wreport/internals/tabledir-test.cc Examining data/wreport-3.23/wreport/internals/tabledir.h Examining data/wreport-3.23/wreport/internals/tabledir.cc Examining data/wreport-3.23/wreport/buffers/crex-test.cc Examining data/wreport-3.23/wreport/buffers/bufr-test.cc Examining data/wreport-3.23/wreport/buffers/crex.cc Examining data/wreport-3.23/wreport/buffers/bufr.cc Examining data/wreport-3.23/wreport/buffers/crex.h Examining data/wreport-3.23/wreport/buffers/bufr.h Examining data/wreport-3.23/wreport/fwd.h Examining data/wreport-3.23/wreport/var.cc Examining data/wreport-3.23/wreport/dtable.h Examining data/wreport-3.23/wreport/tables.cc Examining data/wreport-3.23/wreport/varinfo.h Examining data/wreport-3.23/wreport/dtable-test.cc Examining data/wreport-3.23/wreport/bufr/input.h Examining data/wreport-3.23/wreport/bufr/input.cc Examining data/wreport-3.23/wreport/bufr/decoder-test.cc Examining data/wreport-3.23/wreport/bufr/decoder.h Examining data/wreport-3.23/wreport/bufr/decoder.cc Examining data/wreport-3.23/wreport/bufr/trace.h Examining data/wreport-3.23/wreport/bufr/input-test.cc Examining data/wreport-3.23/wreport/lua-test.cc Examining data/wreport-3.23/wreport/tableinfo.cc Examining data/wreport-3.23/wreport/vartable.cc Examining data/wreport-3.23/wreport/crex_decoder-test.cc Examining data/wreport-3.23/wreport/tests.cc Examining data/wreport-3.23/wreport/opcodes-test.cc Examining data/wreport-3.23/wreport/test-utils-lua.cc Examining data/wreport-3.23/wreport/var-test.cc Examining data/wreport-3.23/wreport/test-utils-lua.h Examining data/wreport-3.23/wreport/tables-test.cc Examining data/wreport-3.23/wreport/benchmark.cc Examining data/wreport-3.23/doc/examples/dump.cc FINAL RESULTS: data/wreport-3.23/wreport/buffers/bufr.cc:9:20: [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 TRACE(...) fprintf(stderr, __VA_ARGS__) data/wreport-3.23/wreport/buffers/crex.cc:9:20: [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 TRACE(...) fprintf(stderr, __VA_ARGS__) data/wreport-3.23/wreport/buffers/crex.cc:179:15: [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 len = vsnprintf(sbuf, 255, fmt, ap); data/wreport-3.23/wreport/buffers/crex.h:173:67: [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 raw_appendf(const char* fmt, ...) __attribute__ ((format(printf, 2, 3))); data/wreport-3.23/wreport/bufr/trace.h:7:20: [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 TRACE(...) fprintf(stderr, __VA_ARGS__) data/wreport-3.23/wreport/bufr_encoder.cc:12:20: [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 TRACE(...) fprintf(stderr, __VA_ARGS__) data/wreport-3.23/wreport/bulletin/internals.cc:11:20: [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 TRACE(...) fprintf(stderr, __VA_ARGS__) data/wreport-3.23/wreport/bulletin/interpreter.cc:12:20: [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 TRACE(...) fprintf(stderr, __VA_ARGS__) data/wreport-3.23/wreport/crex_decoder.cc:10:20: [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 TRACE(...) fprintf(stderr, __VA_ARGS__) data/wreport-3.23/wreport/crex_encoder.cc:9:20: [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 TRACE(...) fprintf(stderr, __VA_ARGS__) data/wreport-3.23/wreport/error.h:56:69: [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. #define WREPORT_THROWF_ATTRS(a, b) __attribute__ ((noreturn, format(printf, a, b))) data/wreport-3.23/wreport/internals/compat.h:83:12: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. return vsprintf (*result, format, args);} data/wreport-3.23/wreport/notes.h:7:59: [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. #define WREPORT_PRINTF_ATTRS(a, b) __attribute__ ((format(printf, a, b))) data/wreport-3.23/wreport/utils/subprocess.cc:485:17: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (execvp(path, (char* const*)exec_args) == -1) data/wreport-3.23/wreport/utils/sys.cc:142:6: [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. bool access(const std::string &s, int m) data/wreport-3.23/wreport/utils/sys.cc:144:14: [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. return ::access(s.c_str(), m) == 0; data/wreport-3.23/wreport/utils/sys.cc:149:17: [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. return sys::access(file, F_OK); data/wreport-3.23/wreport/utils/sys.cc:1107:18: [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 (sys::access(candidate, X_OK)) data/wreport-3.23/wreport/utils/sys.h:82:6: [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. bool access(const std::string& s, int m); data/wreport-3.23/wreport/vartable.cc:23:20: [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 TRACE(...) fprintf(stderr, __VA_ARGS__) data/wreport-3.23/src/examples.cc:82:17: [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. int c = getopt_long(argc, argv, "vh", data/wreport-3.23/src/examples.cc:85:17: [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 c = getopt(argc, argv, "vh"); data/wreport-3.23/src/info.cc:28:75: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. printf("Extra tables directory: %s (env var WREPORT_EXTRA_TABLES)\n", getenv("WREPORT_EXTRA_TABLES")); data/wreport-3.23/src/info.cc:29:70: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. printf("System tables directory: %s (env var WREPORT_TABLES)\n", getenv("WREPORT_TABLES")); data/wreport-3.23/src/wrep.cc:88:17: [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. int c = getopt_long(argc, argv, "cdsDpivtUTFLh:", data/wreport-3.23/src/wrep.cc:91:17: [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 c = getopt(argc, argv, "cdsDpivtUTFLh:"); data/wreport-3.23/wreport/bulletin-bench.cc:51:27: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* datadir = getenv("WREPORT_TESTDATA"); data/wreport-3.23/wreport/bulletin/interpreter-test.cc:51:39: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* testdatadir = getenv("WREPORT_TABLES"); data/wreport-3.23/wreport/dtable-test.cc:19:39: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* testdatadir = getenv("WREPORT_TESTDATA"); data/wreport-3.23/wreport/dtable-test.cc:77:39: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* testdatadir = getenv("WREPORT_TABLES"); data/wreport-3.23/wreport/internals/tabledir.cc:401:21: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (char* env = getenv("WREPORT_EXTRA_TABLES")) data/wreport-3.23/wreport/internals/tabledir.cc:403:21: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (char* env = getenv("WREPORT_TABLES")) data/wreport-3.23/wreport/tests.cc:17:34: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* testdatadirenv = getenv("WREPORT_TESTDATA"); data/wreport-3.23/wreport/tests.cc:46:34: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* testdatadirenv = getenv("WREPORT_TESTDATA"); data/wreport-3.23/wreport/utils/sys.cc:176:6: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. void chroot(const std::string& dir) data/wreport-3.23/wreport/utils/sys.cc:178:11: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if (::chroot(dir.c_str()) == -1) data/wreport-3.23/wreport/utils/sys.cc:1100:24: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* path = getenv("PATH"); data/wreport-3.23/wreport/utils/sys.h:94:6: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. void chroot(const std::string& dir); data/wreport-3.23/wreport/utils/tests-main.cc:27:26: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. bool verbose = (bool)getenv("TEST_VERBOSE"); data/wreport-3.23/wreport/utils/tests-main.cc:34:33: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (const char* whitelist = getenv("TEST_WHITELIST")) data/wreport-3.23/wreport/utils/tests-main.cc:37:33: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (const char* blacklist = getenv("TEST_BLACKLIST")) data/wreport-3.23/wreport/vartable-test.cc:20:23: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* dir = getenv("WREPORT_TESTDATA"); data/wreport-3.23/wreport/vartable-test.cc:27:23: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* dir = getenv("WREPORT_TABLES"); data/wreport-3.23/doc/examples/dump.cc:113: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* in = fopen(argv[i], "rb"); data/wreport-3.23/python/common.cc:11: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[7]; data/wreport-3.23/src/afl-test.cc:30:20: [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* in = fopen(fname, "rb"); data/wreport-3.23/src/input.cc:31: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* in = fopen(fname, "rb"); data/wreport-3.23/src/input.cc:71: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* in = fopen(fname, "rt"); data/wreport-3.23/wreport/buffers/crex.cc:176: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 sbuf[256]; data/wreport-3.23/wreport/bufr/input.cc:213: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 str[info->bit_len / 8 + 2]; data/wreport-3.23/wreport/bufr/input.cc:227: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 buf[info->bit_len / 8 + 1]; data/wreport-3.23/wreport/bufr/input.cc:434: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 str[info->bit_len / 8 + 2]; data/wreport-3.23/wreport/bufr/input.cc:495: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 str[info->bit_len / 8 + 2]; data/wreport-3.23/wreport/bufr/input.cc:601: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 str[info->bit_len / 8 + 2]; data/wreport-3.23/wreport/bufr_encoder.cc:366:9: [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((char*)out.out.data() + sec[4], ((char*)&val) + 1, 3); data/wreport-3.23/wreport/bufr_encoder.cc:403:9: [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((char*)out.out.data() + 4, ((char*)&val) + 1, 3); data/wreport-3.23/wreport/bulletin-bench.cc:60:20: [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* in = fopen(pathname.c_str(), "rb"); data/wreport-3.23/wreport/crex_decoder.cc:41: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. char edition[11]; data/wreport-3.23/wreport/crex_decoder.cc:57: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. char atable[20]; data/wreport-3.23/wreport/dtable.cc:60:20: [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* in = fopen(pathname.c_str(), "rt"); data/wreport-3.23/wreport/dtable.cc:68: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. char line[200]; data/wreport-3.23/wreport/error.cc:121: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 details[512]; data/wreport-3.23/wreport/internals/compat.h:19: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 ((void *)&ap, (void *)&args, sizeof (va_list)); data/wreport-3.23/wreport/subset.cc:86: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 bitmap[size + 1]; data/wreport-3.23/wreport/subset.cc:116: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 bitmap[size + 1]; data/wreport-3.23/wreport/tests.cc:27: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* fd = fopen(fname.c_str(), "rb"); data/wreport-3.23/wreport/tests.cc:61:17: [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* out = fopen(dumpfname.c_str(), "wt"); data/wreport-3.23/wreport/tests.cc:236:17: [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* out = fopen("/dev/null", "w"); data/wreport-3.23/wreport/utils/string.cc:345: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. char buf[5]; data/wreport-3.23/wreport/utils/string.cc:372:31: [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[5] = "0x\0\0"; data/wreport-3.23/wreport/utils/string.cc:377:44: [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). res += (char)atoi(buf); data/wreport-3.23/wreport/utils/string.cc:403: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. char buf[4]; data/wreport-3.23/wreport/utils/subprocess.cc:228:32: [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). fd_devnull.open(O_RDWR); data/wreport-3.23/wreport/utils/subprocess.cc:248:32: [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). fd_devnull.open(O_RDWR); data/wreport-3.23/wreport/utils/subprocess.cc:268:32: [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). fd_devnull.open(O_RDWR); data/wreport-3.23/wreport/utils/sys.cc:563:10: [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). fd = open(pathname, flags | O_PATH); data/wreport-3.23/wreport/utils/sys.cc:571:10: [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). fd = open(pathname.c_str(), flags | O_PATH); data/wreport-3.23/wreport/utils/sys.cc:854: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). open(flags, mode); data/wreport-3.23/wreport/utils/sys.cc:857: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). void File::open(int flags, mode_t mode) data/wreport-3.23/wreport/utils/sys.cc:860: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). fd = ::open(pathname.c_str(), flags, mode); data/wreport-3.23/wreport/utils/sys.cc:868: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). fd = ::open(pathname.c_str(), flags, mode); data/wreport-3.23/wreport/utils/sys.cc:874:12: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). File File::mkstemp(const std::string& prefix) data/wreport-3.23/wreport/utils/sys.cc:877: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(fbuf, prefix.data(), prefix.size()); data/wreport-3.23/wreport/utils/sys.cc:878: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(fbuf + prefix.size(), "XXXXXX", 7); data/wreport-3.23/wreport/utils/sys.cc:879:12: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). return mkstemp(fbuf); data/wreport-3.23/wreport/utils/sys.cc:882:12: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). File File::mkstemp(const char* prefix) data/wreport-3.23/wreport/utils/sys.cc:886: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(fbuf, prefix, prefix_size); data/wreport-3.23/wreport/utils/sys.cc:887: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(fbuf + prefix_size, "XXXXXX", 7); data/wreport-3.23/wreport/utils/sys.cc:888:12: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). return mkstemp(fbuf); data/wreport-3.23/wreport/utils/sys.cc:891:12: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). File File::mkstemp(char* pathname_template) data/wreport-3.23/wreport/utils/sys.cc:893:16: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fd = ::mkstemp(pathname_template); data/wreport-3.23/wreport/utils/sys.cc:900:45: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). Tempfile::Tempfile() : sys::File(sys::File::mkstemp("")) {} data/wreport-3.23/wreport/utils/sys.cc:901:70: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). Tempfile::Tempfile(const std::string& prefix) : sys::File(sys::File::mkstemp(prefix)) {} data/wreport-3.23/wreport/utils/sys.cc:902:63: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). Tempfile::Tempfile(const char* prefix) : sys::File(sys::File::mkstemp(prefix)) {} data/wreport-3.23/wreport/utils/sys.cc:957:22: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). File out = File::mkstemp(file); data/wreport-3.23/wreport/utils/sys.cc:1134: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). int fd = open(pathname.c_str(), O_PATH); data/wreport-3.23/wreport/utils/sys.h:495:10: [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(int flags, mode_t mode=0777); data/wreport-3.23/wreport/utils/sys.h:503:17: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). static File mkstemp(const std::string& prefix); data/wreport-3.23/wreport/utils/sys.h:504:17: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). static File mkstemp(const char* prefix); data/wreport-3.23/wreport/utils/sys.h:505:17: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). static File mkstemp(char* pathname_template); data/wreport-3.23/wreport/utils/testrunner.cc:161: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 elapsed[32]; data/wreport-3.23/wreport/utils/testrunner.cc:179: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 elapsed[32]; data/wreport-3.23/wreport/utils/testrunner.cc:387: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. char elapsed[32]; data/wreport-3.23/wreport/utils/testrunner.cc:401: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. char elapsed[32]; data/wreport-3.23/wreport/var-lua.cc:90: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[10]; data/wreport-3.23/wreport/var.cc:51:18: [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 char digits[201] = data/wreport-3.23/wreport/var.cc:215: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(m_value.c, var.m_value.c, m_info->len); data/wreport-3.23/wreport/var.cc:219: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(m_value.c, var.m_value.c, m_info->len + 1); data/wreport-3.23/wreport/var.cc:453:9: [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_value.c, val, size); data/wreport-3.23/wreport/var.cc:457:9: [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_value.c, val, m_info->len); data/wreport-3.23/wreport/var.cc:695:17: [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/wreport-3.23/wreport/var.cc:705: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. char buf[30]; data/wreport-3.23/wreport/varinfo.cc:88: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 buf[8]; data/wreport-3.23/wreport/varinfo.h:145: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 desc[64]; data/wreport-3.23/wreport/varinfo.h:149: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 unit[24]; data/wreport-3.23/wreport/vartable.cc:326:9: [2] (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). Risk is low because the source is a constant string. strcpy(unit, "CODE TABLE"); data/wreport-3.23/wreport/vartable.cc:329:9: [2] (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). Risk is low because the source is a constant string. strcpy(unit, "FLAG TABLE"); data/wreport-3.23/wreport/vartable.cc:337:20: [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* in = fopen(pathname.c_str(), "rt"); data/wreport-3.23/wreport/vartable.cc:341: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. char line[200]; data/wreport-3.23/wreport/vartable.cc:357: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(entry->desc, line+8, 64); data/wreport-3.23/wreport/vartable.cc:363: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(entry->unit, line+73, 24); data/wreport-3.23/wreport/vartable.cc:410:20: [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* in = fopen(pathname.c_str(), "rt"); data/wreport-3.23/wreport/vartable.cc:414: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. char line[200]; data/wreport-3.23/wreport/vartable.cc:438: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(entry->desc, line+8, 64); data/wreport-3.23/wreport/vartable.cc:444: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(entry->unit, line+119, 24); data/wreport-3.23/doc/examples/dump.cc:48:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (TYPE::read(in, buf, fname)) data/wreport-3.23/src/afl-test.cc:48:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (BufrBulletin::read(in, raw_data, fname, &offset)) data/wreport-3.23/src/input.cc:49:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (BufrBulletin::read(in, raw_data, fname, &offset)) data/wreport-3.23/src/input.cc:92:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (CrexBulletin::read(in, raw_data, fname, &offset)) data/wreport-3.23/src/options.cc:31: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). while (str && *str && strlen(str) >= 6) data/wreport-3.23/wreport/bulletin-bench.cc:65:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (Bltn::read(in, buf, pathname.c_str(), &offset)) data/wreport-3.23/wreport/bulletin.cc:25:34: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (got < sig_len && (c = getc(fd)) != EOF) data/wreport-3.23/wreport/bulletin.cc:457:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool BufrBulletin::read(FILE* fd, std::string& buf, const char* fname, off_t* offset) data/wreport-3.23/wreport/bulletin.cc:609:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool CrexBulletin::read(FILE* fd, std::string& buf, const char* fname, off_t* offset) data/wreport-3.23/wreport/bulletin.cc:633:26: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (got < 8 && (c = getc(fd)) != EOF) data/wreport-3.23/wreport/bulletin.h:294:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). static bool read(FILE* in, std::string& buf, const char* fname=0, off_t* offset=0); data/wreport-3.23/wreport/bulletin.h:457:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). static bool read(FILE* in, std::string& buf, const char* fname=0, off_t* offset=0); data/wreport-3.23/wreport/crex_decoder.cc:61: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). switch (strlen(atable)-1) data/wreport-3.23/wreport/crex_decoder.cc:76:96: [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_consistency::throwf("Cannot parse an A table indicator %zd digits long", strlen(atable)); data/wreport-3.23/wreport/dtable.cc:73: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 (strlen(line) < 18) data/wreport-3.23/wreport/internals/compat.h:16: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). int total_width = strlen (format) + 1; data/wreport-3.23/wreport/internals/compat.h:71: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). total_width += strlen (va_arg (ap, char *)); data/wreport-3.23/wreport/internals/tabledir.cc:79: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). size_t name_len = strlen(e.d_name); data/wreport-3.23/wreport/internals/tabledir.cc:88:25: [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). switch (strlen(e.d_name)) data/wreport-3.23/wreport/utils/sys.cc:182:8: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode_t umask(mode_t mask) data/wreport-3.23/wreport/utils/sys.cc:184:14: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). return ::umask(mask); data/wreport-3.23/wreport/utils/sys.cc:290:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t FileDescriptor::read(void* buf, size_t count) data/wreport-3.23/wreport/utils/sys.cc:292:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t res = ::read(fd, buf, count); data/wreport-3.23/wreport/utils/sys.cc:300:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t res = read(buf, count); data/wreport-3.23/wreport/utils/sys.cc:884:26: [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 prefix_size = strlen(prefix); data/wreport-3.23/wreport/utils/sys.cc:960:19: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode_t mask = umask(0777); data/wreport-3.23/wreport/utils/sys.cc:961:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(mask); data/wreport-3.23/wreport/utils/sys.h:97:8: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode_t umask(mode_t mask); data/wreport-3.23/wreport/utils/sys.h:197:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t read(void* buf, size_t count); data/wreport-3.23/wreport/var.cc:469:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(m_value.c, val, size); data/wreport-3.23/wreport/var.cc:472:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(m_value.c, val, m_info->len); data/wreport-3.23/wreport/var.cc:538: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). case Vartype::String: assign_c_checked(val, strlen(val)); break; data/wreport-3.23/wreport/varinfo.cc:100:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(this->desc, desc, 63); this->desc[63] = 0; data/wreport-3.23/wreport/varinfo.cc:101:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(this->unit, unit, 23); this->unit[23] = 0; data/wreport-3.23/wreport/varinfo.cc:121:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(this->desc, desc, 63); this->desc[63] = 0; data/wreport-3.23/wreport/varinfo.cc:122:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(this->unit, unit, 23); this->unit[23] = 0; data/wreport-3.23/wreport/varinfo.cc:139:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(this->desc, desc, 63); this->desc[63] = 0; data/wreport-3.23/wreport/varinfo.cc:140:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(this->unit, "CCITTIA5", 24); data/wreport-3.23/wreport/varinfo.cc:152:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(this->desc, desc, 63); this->desc[63] = 0; data/wreport-3.23/wreport/varinfo.cc:153:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(this->unit, "UNKNOWN", 24); data/wreport-3.23/wreport/vartable.cc:347: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 (strlen(line) < 119) data/wreport-3.23/wreport/vartable.cc:421: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 (strlen(line) < 157) ANALYSIS SUMMARY: Hits = 167 Lines analyzed = 26935 in approximately 0.76 seconds (35256 lines/second) Physical Source Lines of Code (SLOC) = 18198 Hits@level = [0] 166 [1] 42 [2] 82 [3] 23 [4] 20 [5] 0 Hits@level+ = [0+] 333 [1+] 167 [2+] 125 [3+] 43 [4+] 20 [5+] 0 Hits/KSLOC@level+ = [0+] 18.2987 [1+] 9.17683 [2+] 6.86889 [3+] 2.3629 [4+] 1.09902 [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.