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/ggcov-0.10/src/summarywin.H Examining data/ggcov-0.10/src/mvc.c Examining data/ggcov-0.10/src/argparse.H Examining data/ggcov-0.10/src/canvas_scenegen.C Examining data/ggcov-0.10/src/yaml_generator.H Examining data/ggcov-0.10/src/canvas_scenegen.H Examining data/ggcov-0.10/src/toktest.c Examining data/ggcov-0.10/src/fakepopt.h Examining data/ggcov-0.10/src/hashtabletest.c Examining data/ggcov-0.10/src/cov_arc.C Examining data/ggcov-0.10/src/confsection.C Examining data/ggcov-0.10/src/cov_function.C Examining data/ggcov-0.10/src/cov_calliter.C Examining data/ggcov-0.10/src/ui.h Examining data/ggcov-0.10/src/php_scenegen.H Examining data/ggcov-0.10/src/mangletest.c Examining data/ggcov-0.10/src/cov_bfd.C Examining data/ggcov-0.10/src/yamltest.C Examining data/ggcov-0.10/src/reportwin.C Examining data/ggcov-0.10/src/cov_elf.C Examining data/ggcov-0.10/src/reportwin.H Examining data/ggcov-0.10/src/check_scenegen.H Examining data/ggcov-0.10/src/functionswin.C Examining data/ggcov-0.10/src/uix.h Examining data/ggcov-0.10/src/cov_scope.H Examining data/ggcov-0.10/src/report.H Examining data/ggcov-0.10/src/hashtable.H Examining data/ggcov-0.10/src/flow_diagram.H Examining data/ggcov-0.10/src/cov_callgraph.C Examining data/ggcov-0.10/src/check_scenegen.C Examining data/ggcov-0.10/src/fileswin.H Examining data/ggcov-0.10/src/fileswin.C Examining data/ggcov-0.10/src/diagwin.C Examining data/ggcov-0.10/src/logging.H Examining data/ggcov-0.10/src/cov_priv.H Examining data/ggcov-0.10/src/scenegen.C Examining data/ggcov-0.10/src/testfw.H Examining data/ggcov-0.10/src/uniqueptrtest.C Examining data/ggcov-0.10/src/lego_diagram.H Examining data/ggcov-0.10/src/prefs.C Examining data/ggcov-0.10/src/mvc.h Examining data/ggcov-0.10/src/mustache.H Examining data/ggcov-0.10/src/confsection.H Examining data/ggcov-0.10/src/report.C Examining data/ggcov-0.10/src/filetest.c Examining data/ggcov-0.10/src/callgraphwin.H Examining data/ggcov-0.10/src/cov_project_params.C Examining data/ggcov-0.10/src/utils.C Examining data/ggcov-0.10/src/covio.C Examining data/ggcov-0.10/src/yaml_generator.C Examining data/ggcov-0.10/src/cov_stab32.C Examining data/ggcov-0.10/src/php_serializer.C Examining data/ggcov-0.10/src/common.h Examining data/ggcov-0.10/src/phptest.C Examining data/ggcov-0.10/src/cov_block.C Examining data/ggcov-0.10/src/tok.H Examining data/ggcov-0.10/src/cached_string.H Examining data/ggcov-0.10/src/prefs.H Examining data/ggcov-0.10/src/php_scenegen.C Examining data/ggcov-0.10/src/scopetest.C Examining data/ggcov-0.10/src/cpp_parser.C Examining data/ggcov-0.10/src/cov_calliter.H Examining data/ggcov-0.10/src/teststarter.h Examining data/ggcov-0.10/src/window.H Examining data/ggcov-0.10/src/teststarter.c Examining data/ggcov-0.10/src/cov_specific.C Examining data/ggcov-0.10/src/callgraphwin.C Examining data/ggcov-0.10/src/cov_function.H Examining data/ggcov-0.10/src/estring.H Examining data/ggcov-0.10/src/scenegen.H Examining data/ggcov-0.10/src/help.c Examining data/ggcov-0.10/src/covio.H Examining data/ggcov-0.10/src/statustest.C Examining data/ggcov-0.10/src/string_var.H Examining data/ggcov-0.10/src/cov_types.H Examining data/ggcov-0.10/src/cov_arc.H Examining data/ggcov-0.10/src/hashtable.C Examining data/ggcov-0.10/src/ui.c Examining data/ggcov-0.10/src/logging.C Examining data/ggcov-0.10/src/filename.c Examining data/ggcov-0.10/src/mustache.C Examining data/ggcov-0.10/src/libiberty/demangle.h Examining data/ggcov-0.10/src/callswin.C Examining data/ggcov-0.10/src/diagwin.H Examining data/ggcov-0.10/src/argparse.C Examining data/ggcov-0.10/src/cov_bfd.H Examining data/ggcov-0.10/src/cov_line.C Examining data/ggcov-0.10/src/cov_callgraph.H Examining data/ggcov-0.10/src/gnbstackedbar.c Examining data/ggcov-0.10/src/unicode.H Examining data/ggcov-0.10/src/cov_scope.C Examining data/ggcov-0.10/src/sourcewin.H Examining data/ggcov-0.10/src/estring.C Examining data/ggcov-0.10/src/cov_i386.C Examining data/ggcov-0.10/src/tok.C Examining data/ggcov-0.10/src/colors.h Examining data/ggcov-0.10/src/utils.H Examining data/ggcov-0.10/src/estringtest.c Examining data/ggcov-0.10/src/libgd_scenegen.C Examining data/ggcov-0.10/src/common.c Examining data/ggcov-0.10/src/cov.H Examining data/ggcov-0.10/src/cov_dwarf2.C Examining data/ggcov-0.10/src/fakepopt.c Examining data/ggcov-0.10/src/prefswin.C Examining data/ggcov-0.10/src/list.H Examining data/ggcov-0.10/src/demangle.h Examining data/ggcov-0.10/src/ggcov.c Examining data/ggcov-0.10/src/canvas_function_popup.H Examining data/ggcov-0.10/src/cov_file.H Examining data/ggcov-0.10/src/libgd_scenegen.H Examining data/ggcov-0.10/src/lego_diagram.C Examining data/ggcov-0.10/src/callgraph_diagram.H Examining data/ggcov-0.10/src/demangle.c Examining data/ggcov-0.10/src/listtest.c Examining data/ggcov-0.10/src/cov.C Examining data/ggcov-0.10/src/filerec.C Examining data/ggcov-0.10/src/testfw.C Examining data/ggcov-0.10/src/filerec.H Examining data/ggcov-0.10/src/cov_project_params.H Examining data/ggcov-0.10/src/callgraph_diagram.C Examining data/ggcov-0.10/src/flow_diagram.C Examining data/ggcov-0.10/src/unique_ptr.H Examining data/ggcov-0.10/src/popttest.c Examining data/ggcov-0.10/src/ggcov-webdb.c Examining data/ggcov-0.10/src/sourcewin.C Examining data/ggcov-0.10/src/cov_line.H Examining data/ggcov-0.10/src/ggcov-html.c Examining data/ggcov-0.10/src/cov_suppression.C Examining data/ggcov-0.10/src/libggcov/intercept.c Examining data/ggcov-0.10/src/cov_suppression.H Examining data/ggcov-0.10/src/cpp_parser.H Examining data/ggcov-0.10/src/uicommon.h Examining data/ggcov-0.10/src/gnbstackedbar.h Examining data/ggcov-0.10/src/summarywin.C Examining data/ggcov-0.10/src/functionswin.H Examining data/ggcov-0.10/src/ptrarray.H Examining data/ggcov-0.10/src/php_serializer.H Examining data/ggcov-0.10/src/unicode.C Examining data/ggcov-0.10/src/geometry.H Examining data/ggcov-0.10/src/tggcov.c Examining data/ggcov-0.10/src/prefswin.H Examining data/ggcov-0.10/src/uix.c Examining data/ggcov-0.10/src/mustachetest.C Examining data/ggcov-0.10/src/cov_block.H Examining data/ggcov-0.10/src/canvas_function_popup.C Examining data/ggcov-0.10/src/callswin.H Examining data/ggcov-0.10/src/testrunner.c Examining data/ggcov-0.10/src/window.C Examining data/ggcov-0.10/src/cov_specific.H Examining data/ggcov-0.10/src/filename.h Examining data/ggcov-0.10/src/diagram.H Examining data/ggcov-0.10/src/diagram.C Examining data/ggcov-0.10/src/argstest.C Examining data/ggcov-0.10/src/cached_string.C Examining data/ggcov-0.10/src/cov_file.C Examining data/ggcov-0.10/test/test016/foo.c Examining data/ggcov-0.10/test/test001/foo.c Examining data/ggcov-0.10/test/test011/foo.c Examining data/ggcov-0.10/test/test033/foo.c Examining data/ggcov-0.10/test/test034/foo.c Examining data/ggcov-0.10/test/test026/bar.c Examining data/ggcov-0.10/test/test026/foo.c Examining data/ggcov-0.10/test/test026/quux.c Examining data/ggcov-0.10/test/test026/quux.h Examining data/ggcov-0.10/test/test014/foo.c Examining data/ggcov-0.10/test/test014/xbaz.c Examining data/ggcov-0.10/test/test014/xbar.h Examining data/ggcov-0.10/test/test014/xbaz.h Examining data/ggcov-0.10/test/test014/xbar.c Examining data/ggcov-0.10/test/test006/foo.c Examining data/ggcov-0.10/test/test002/foo.c Examining data/ggcov-0.10/test/test009/odd.h Examining data/ggcov-0.10/test/test009/subdir/even.h Examining data/ggcov-0.10/test/test009/even.h Examining data/ggcov-0.10/test/test009/foo.C Examining data/ggcov-0.10/test/test008/foo.c Examining data/ggcov-0.10/test/test013/foo.c Examining data/ggcov-0.10/test/test010/bar.c Examining data/ggcov-0.10/test/test010/foo.c Examining data/ggcov-0.10/test/test004/foo.cc Examining data/ggcov-0.10/test/test029/bar.c Examining data/ggcov-0.10/test/test029/baz.c Examining data/ggcov-0.10/test/test029/foo.c Examining data/ggcov-0.10/test/test029/quux.c Examining data/ggcov-0.10/test/test029/foo.h Examining data/ggcov-0.10/test/test005/foo.C Examining data/ggcov-0.10/test/test030/foo.c Examining data/ggcov-0.10/test/test007/foo.c Examining data/ggcov-0.10/ui/ui_strs.c FINAL RESULTS: data/ggcov-0.10/src/covio.C:218:10: [5] (buffer) gets: Does not check for buffer overflows (CWE-120, CWE-20). Use fgets() instead. covio_t::gets(estring &e, unsigned int maxlen) data/ggcov-0.10/src/covio.H:131:14: [5] (buffer) gets: Does not check for buffer overflows (CWE-120, CWE-20). Use fgets() instead. gboolean gets(estring &e, unsigned int maxlen); data/ggcov-0.10/src/common.c:36:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/ggcov-0.10/src/common.h:109:25: [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. __attribute__ (( format(printf,1,2) )) data/ggcov-0.10/src/cov_elf.C:161:2: [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(buf, sizeof(buf), ELF_ADDR_FMT, (long unsigned)d->value); data/ggcov-0.10/src/estring.C:82:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(data_+length_, fmt, args2); data/ggcov-0.10/src/estring.H:29:27: [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. __attribute (( format(printf, fmtidx, firsta) )) data/ggcov-0.10/src/filetest.c:23:9: [4] (shell) system: 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. r = system("rm -rf " TESTDIR); data/ggcov-0.10/src/filetest.c:51:9: [4] (shell) system: 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. r = system("rm -rf " TESTDIR); data/ggcov-0.10/src/ggcov-webdb.c:122:65: [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. static int systemf(const char *fmt, ...) __attribute__(( format(printf,1,2) )); data/ggcov-0.10/src/ggcov-webdb.c:136:12: [4] (shell) system: 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. return system(cmd.data()); data/ggcov-0.10/src/ggcov.c:73:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(p, argv[i]); data/ggcov-0.10/src/libggcov/intercept.c:136:6: [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(p, flagdesc[i].name); data/ggcov-0.10/src/libggcov/intercept.c:252:6: [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(freeme, prefix); data/ggcov-0.10/src/libggcov/intercept.c:253:6: [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(freeme, filename); data/ggcov-0.10/src/logging.C:50:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(fp_, fmt, args); data/ggcov-0.10/src/mustache.C:71:17: [4] (shell) popen: 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. stdin_fp_ = popen(cmd, "w"); data/ggcov-0.10/src/php_serializer.C:174:2: [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(bb, sizeof(bb), INFLATED_FORMAT, a->seen_/2); data/ggcov-0.10/src/report.C:299:24: [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. __attribute__((format(printf,3,4))) data/ggcov-0.10/src/testfw.C:45:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/ggcov-0.10/src/testfw.C:489: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. vsnprintf(buf+strlen(buf), sizeof(buf)-2-strlen(buf), fmt, args); data/ggcov-0.10/src/teststarter.c:217:12: [4] (shell) system: 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. return system(cmd); data/ggcov-0.10/src/cov_elf.C:240:15: [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. add_to_rpath(getenv("LD_LIBRARY_PATH")); data/ggcov-0.10/src/filename.c:549:14: [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. tmpdir = getenv("TMPDIR"); data/ggcov-0.10/src/ggcov-webdb.c:114:15: [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. char *v = getenv("TMPDIR"); data/ggcov-0.10/src/libggcov/intercept.c:243:15: [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. prefix = getenv("_GGCOV_GCDA_PREFIX"); data/ggcov-0.10/src/testrunner.c:41: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. while ((i = getopt(argc, argv, "vld")) >= 0) data/ggcov-0.10/src/argparse.C:126: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[2]; data/ggcov-0.10/src/argparse.C:227: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(&popts[0], headers, sizeof(headers)); data/ggcov-0.10/src/argparse.C:240: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(&popts[n], trailers, sizeof(trailers)); data/ggcov-0.10/src/callgraph_diagram.C:648: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. static char buf[32]; data/ggcov-0.10/src/callgraphwin.C:308: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 *text[NUM_COLS]; data/ggcov-0.10/src/callgraphwin.C:309: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 countbuf[32]; data/ggcov-0.10/src/callswin.C:259: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. const char *text[NUM_COLS]; data/ggcov-0.10/src/callswin.C:260: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 countbuf[32]; data/ggcov-0.10/src/callswin.C:261: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 linebuf[32]; data/ggcov-0.10/src/canvas_function_popup.C:86: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. static char buf[256]; data/ggcov-0.10/src/canvas_function_popup.H:66: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 foreground_[32]; data/ggcov-0.10/src/canvas_function_popup.H:67: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 background_[32]; data/ggcov-0.10/src/canvas_function_popup.H:68: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 coverage_[128]; data/ggcov-0.10/src/canvas_scenegen.H:63: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 fill_buf_[8]; data/ggcov-0.10/src/canvas_scenegen.H:65: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 border_buf_[8]; data/ggcov-0.10/src/common.c:139:11: [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). fp = fopen(filename, "w"); data/ggcov-0.10/src/confsection.C:169: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[32]; data/ggcov-0.10/src/cov.C:238:13: [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). if (!b->open(exefilename)) data/ggcov-0.10/src/cov.C:540: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. static const char *status_names[cov::NUM_STATUS] = data/ggcov-0.10/src/cov.C:722: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 *names[cov::NUM_STATUS] = data/ggcov-0.10/src/cov.C:735: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 *names[cov::NUM_STATUS] = data/ggcov-0.10/src/cov_bfd.C:99: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). cov_bfd_t::open(const char *filename) data/ggcov-0.10/src/cov_bfd.C:111: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). cov_bfd_t::open(const char *filename, FILE *fp) data/ggcov-0.10/src/cov_bfd.C:166: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(sorted_symbols_, symbols_, num_symbols_*sizeof(*symbols_)); data/ggcov-0.10/src/cov_bfd.C:313: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 reltype[32]; data/ggcov-0.10/src/cov_bfd.C:479:21: [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). gboolean cov_bfd_t::open(const char *filename) data/ggcov-0.10/src/cov_bfd.H:84: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). gboolean open(const char *filename); data/ggcov-0.10/src/cov_bfd.H:85: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). gboolean open(const char *filename, FILE *); data/ggcov-0.10/src/cov_bfd.H:178: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). gboolean open(const char *filename); data/ggcov-0.10/src/cov_dwarf2.C:157: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((void *)valp, ptr_, sizeof(*valp)); data/ggcov-0.10/src/cov_dwarf2.C:169: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((void *)valp, ptr_, sizeof(*valp)); data/ggcov-0.10/src/cov_dwarf2.C:181: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((void *)valp, ptr_, sizeof(*valp)); data/ggcov-0.10/src/cov_dwarf2.C:193: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((void *)valp, ptr_, sizeof(*valp)); data/ggcov-0.10/src/cov_elf.C:139: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. static char buf[32]; data/ggcov-0.10/src/cov_elf.C:156: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. static char buf[32]; data/ggcov-0.10/src/cov_file.C:1398: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 magic[MAX_MAGIC_LEN]; data/ggcov-0.10/src/cov_file.C:1897:16: [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). if (!cbfd->open(io->filename(), io->take()) || cbfd->num_symbols() == 0) data/ggcov-0.10/src/cov_file.C:2347: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). if ((fp_ = fopen(file_->name(), "r")) == 0) data/ggcov-0.10/src/cov_file.C:2393:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[32]; data/ggcov-0.10/src/cov_file.C:2402: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. static char buf[512]; data/ggcov-0.10/src/cov_file.H:360: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_[1024]; data/ggcov-0.10/src/covio.C:50:19: [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). return (fp_ = fopen(fn_, "r")) != NULL; data/ggcov-0.10/src/cpp_parser.C:246:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char cbuf[8]; data/ggcov-0.10/src/cpp_parser.C: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 buf[1024]; data/ggcov-0.10/src/cpp_parser.C:603: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). if ((fp = fopen(filename_, "r")) == 0) data/ggcov-0.10/src/cpp_parser.H:111: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 tokenbuf_[256]; data/ggcov-0.10/src/estring.C:60: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_[length_], buf, buflen); data/ggcov-0.10/src/estring.H:76:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data_, s, len); data/ggcov-0.10/src/estringtest.c:752:5: [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(x, "scares the"); data/ggcov-0.10/src/filename.c:130: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). if ((fd = open(filename, flags, mode)) < 0) data/ggcov-0.10/src/filename.c:476: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[4096]; data/ggcov-0.10/src/filename.c:480:19: [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). if ((fdfrom = open(filefrom, O_RDONLY)) < 0) data/ggcov-0.10/src/filename.c:490:17: [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). if ((fdto = open(tmp_fileto, O_WRONLY|O_CREAT|O_TRUNC, statfrom.st_mode)) < 0) data/ggcov-0.10/src/fileswin.C:309: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 *text[NUM_COLS]; data/ggcov-0.10/src/fileswin.C:310: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 blocks_pc_buf[16]; data/ggcov-0.10/src/fileswin.C:311: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 lines_pc_buf[16]; data/ggcov-0.10/src/fileswin.C:312: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 functions_pc_buf[16]; data/ggcov-0.10/src/fileswin.C:313: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 calls_pc_buf[16]; data/ggcov-0.10/src/fileswin.C:314: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 branches_pc_buf[16]; data/ggcov-0.10/src/filetest.c:16: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 oldcwd[PATH_MAX]; data/ggcov-0.10/src/flow_diagram.C:874: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 label[64]; data/ggcov-0.10/src/functionswin.C:281: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 *text[NUM_COLS]; data/ggcov-0.10/src/functionswin.C:282: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 blocks_pc_buf[16]; data/ggcov-0.10/src/functionswin.C:283: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 lines_pc_buf[16]; data/ggcov-0.10/src/functionswin.C:284: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 calls_pc_buf[16]; data/ggcov-0.10/src/functionswin.C:285: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 branches_pc_buf[16]; data/ggcov-0.10/src/ggcov-html.c:111: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[1024]; data/ggcov-0.10/src/ggcov-html.c: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). if ((fp = fopen(filename, "r")) == 0) data/ggcov-0.10/src/ggcov-webdb.c:147: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 blocks_buf[64]; data/ggcov-0.10/src/ggcov-webdb.c:649:15: [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). if ((fd = mkstemp((char *)tmp_filename.data())) < 0) data/ggcov-0.10/src/ggcov-webdb.c:903: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). ret = db->open(db, OPEN_TXN webdb_file, 0, DB_HASH, DB_CREATE, 0644); data/ggcov-0.10/src/ggcov-webdb.c:981:20: [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). if ((ret = db->open(db, OPEN_TXN webdb_file, 0, DB_HASH, DB_CREATE, 0644))) data/ggcov-0.10/src/libgd_scenegen.C:225: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 *fp = fopen(newfilename, "w"); data/ggcov-0.10/src/libggcov/intercept.c:144:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, "0x%x", flags); data/ggcov-0.10/src/libggcov/intercept.c:215:1: [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(const char *filename, int flags, ...) data/ggcov-0.10/src/libggcov/intercept.c:276: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 flagbuf[256]; data/ggcov-0.10/src/mustache.C:65: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 cmd[1024]; data/ggcov-0.10/src/mustachetest.C:54: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 *fp = fopen(path, "w"); data/ggcov-0.10/src/mustachetest.C:63: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 actual[4096]; data/ggcov-0.10/src/mustachetest.C:66: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 *fp = fopen(path, "r"); data/ggcov-0.10/src/php_serializer.C:173: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 bb[INFLATED_LENGTH+1]; data/ggcov-0.10/src/php_serializer.C:175: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((char *)buf_.data() + a->count_offset_, bb, INFLATED_LENGTH); data/ggcov-0.10/src/prefs.C:145: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. static char buf[16]; data/ggcov-0.10/src/report.C:403: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[64]; data/ggcov-0.10/src/reportwin.C:116:15: [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). if ((fd = mkstemp(fname)) < 0) data/ggcov-0.10/src/reportwin.C:136: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[1024]; data/ggcov-0.10/src/reportwin.C:194: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 *fp = fopen(filename, "w"); data/ggcov-0.10/src/sourcewin.C:645:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf+len, spaces, ns); data/ggcov-0.10/src/sourcewin.C:692: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. const char *strs[NUM_COLS]; data/ggcov-0.10/src/sourcewin.C:693: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 linenobuf[32]; data/ggcov-0.10/src/sourcewin.C:694: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 blockbuf[32]; data/ggcov-0.10/src/sourcewin.C:695: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 countbuf[32]; data/ggcov-0.10/src/sourcewin.C:696: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 linebuf[1024]; data/ggcov-0.10/src/sourcewin.C:703: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). if ((fp = fopen(filename_, "r")) == 0) data/ggcov-0.10/src/sourcewin.C:1130: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). if ((fp = fopen(filename, "w")) == 0) data/ggcov-0.10/src/sourcewin.H:121: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 *column_names_[NUM_COLS]; data/ggcov-0.10/src/testfw.C:81: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(r, s, sz); data/ggcov-0.10/src/testfw.C:395: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[STATUS_LEN]; data/ggcov-0.10/src/testfw.C:409: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[STATUS_LEN]; data/ggcov-0.10/src/testfw.C:480: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[STATUS_LEN]; data/ggcov-0.10/src/teststarter.c:84: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 *fp = fopen(path, "w"); data/ggcov-0.10/src/tggcov.c:162: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). if ((outfp = fopen(ggcov_filename, "w")) == 0) data/ggcov-0.10/src/tggcov.c:224: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 blocks_buf[BLOCKS_WIDTH]; data/ggcov-0.10/src/tggcov.c:358: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). if ((fp = fopen(cgfilename, "w")) == 0) data/ggcov-0.10/src/uix.c:115: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. const char *fields[16]; data/ggcov-0.10/src/uix.c:116: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 sizebuf[16]; data/ggcov-0.10/src/uix.c:117: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 resbuf[16]; data/ggcov-0.10/src/uix.c:177:20: [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. tmpdesc.family = (char *)families[i]; data/ggcov-0.10/src/uix.c:187:20: [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. tmpdesc.family = (char *)families[i]; data/ggcov-0.10/src/uix.c:249: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 errmsg[1024]; data/ggcov-0.10/src/window.C:63: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(text, data, length); data/ggcov-0.10/test/test001/foo.c:47:10: [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). x = atoi(argv[i]); /* C(4) */ data/ggcov-0.10/test/test002/foo.c:34:9: [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). x = atoi(argv[1]); /* C(4) */ data/ggcov-0.10/test/test004/foo.cc:54:9: [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). x = atoi(argv[1]); /* C(4) */ data/ggcov-0.10/test/test005/foo.C:48:11: [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). do_stuff(atoi(argv[i])); /* C(1,1) C(2,2) C(3,3) C(4,42) C(5,-1) */ data/ggcov-0.10/test/test006/foo.c:36:9: [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). x = atoi(arg); /* C(4) */ data/ggcov-0.10/test/test007/foo.c:40:9: [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). x = atoi(argv[1]); /* C(4) */ data/ggcov-0.10/test/test008/foo.c:5:1: [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 blocktrace[1024]; /* C(-) */ data/ggcov-0.10/test/test008/foo.c:15:9: [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). N = atoi(argv[1]); /* C(1,0) C(2,1) C(3,3) C(4,10) */ data/ggcov-0.10/test/test009/foo.C:25:6: [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). x = atoi(argv[i]); /* C(5) */ data/ggcov-0.10/test/test010/foo.c:12:9: [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). x = atoi(argv[1]); /* C(4) */ data/ggcov-0.10/test/test011/foo.c:99:10: [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). x = atoi(argv[i]); /* C(4) */ data/ggcov-0.10/test/test013/foo.c:37:9: [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). x = atoi(argv[1]); /* C(4) */ data/ggcov-0.10/test/test014/foo.c:12:9: [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). x = atoi(argv[1]); /* C(4) */ data/ggcov-0.10/test/test016/foo.c:76:10: [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). x = atoi(argv[i]); data/ggcov-0.10/test/test026/bar.c:11:10: [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). x = atoi(argv[i]); /* C(0) */ data/ggcov-0.10/test/test026/foo.c:11:10: [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). x = atoi(argv[i]); /* C(4) */ data/ggcov-0.10/test/test030/foo.c:22:6: [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). x = atoi(argv[i]); /* C(4) */ data/ggcov-0.10/test/test033/foo.c:28:6: [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). x = atoi(argv[i]); /* S(CO) */ data/ggcov-0.10/test/test034/foo.c:47:10: [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). x = atoi(argv[i]); /* C(4) */ data/ggcov-0.10/src/cached_string.H:98: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). return (data_ == 0 ? 0 : strlen(data_)); data/ggcov-0.10/src/callswin.C:275:6: [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(linebuf, "WTF??", sizeof(linebuf)); data/ggcov-0.10/src/canvas_function_popup.C:70:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(foreground_, s, sizeof(foreground_)); data/ggcov-0.10/src/canvas_function_popup.C:77:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(background_, s, sizeof(background_)); data/ggcov-0.10/src/common.c:70:28: [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 (do_write(2, argv0, strlen(argv0)) < 0) data/ggcov-0.10/src/cov.C:100:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!f->read(quiet)) data/ggcov-0.10/src/cov_file.C:244:19: [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). common_len_ = strlen(common_path_); data/ggcov-0.10/src/cov_file.C:847: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). unsigned int rellen = strlen(relpath); data/ggcov-0.10/src/cov_file.C:848: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). unsigned int abslen = strlen(abspath); data/ggcov-0.10/src/cov_file.C:1403:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (io->read(magic, MAX_MAGIC_LEN) != MAX_MAGIC_LEN) data/ggcov-0.10/src/cov_file.C:2193:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cov_file_t::read(gboolean quiet) data/ggcov-0.10/src/cov_file.H:255:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). gboolean read(gboolean quiet); data/ggcov-0.10/src/cov_line.C:154:8: [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). len = strlen(buf); data/ggcov-0.10/src/cov_line.C:167:8: [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). len = strlen(buf); data/ggcov-0.10/src/cov_stab32.C:148:12: [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 (s[strlen(s)-1] == '/') data/ggcov-0.10/src/covio.C:61:23: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w = (unsigned int)fgetc(fp_) & 0xff; data/ggcov-0.10/src/covio.C:62:25: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((unsigned int)fgetc(fp_) & 0xff) << 8; data/ggcov-0.10/src/covio.C:63:25: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((unsigned int)fgetc(fp_) & 0xff) << 16; data/ggcov-0.10/src/covio.C:64:25: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((unsigned int)fgetc(fp_) & 0xff) << 24; data/ggcov-0.10/src/covio.C:79:25: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w = ((unsigned int)fgetc(fp_) & 0xff) << 24; data/ggcov-0.10/src/covio.C:80:25: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((unsigned int)fgetc(fp_) & 0xff) << 16; data/ggcov-0.10/src/covio.C:81:25: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((unsigned int)fgetc(fp_) & 0xff) << 8; data/ggcov-0.10/src/covio.C:82:24: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= (unsigned int)fgetc(fp_) & 0xff; data/ggcov-0.10/src/covio.C:99:19: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w = (uint64_t)fgetc(fp_) & 0xff; data/ggcov-0.10/src/covio.C:100:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 8; data/ggcov-0.10/src/covio.C:101:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 16; data/ggcov-0.10/src/covio.C:102:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 24; data/ggcov-0.10/src/covio.C:104:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 32; data/ggcov-0.10/src/covio.C:105:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 40; data/ggcov-0.10/src/covio.C:106:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 48; data/ggcov-0.10/src/covio.C:107:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 56; data/ggcov-0.10/src/covio.C:122:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w = ((uint64_t)fgetc(fp_) & 0xff) << 56; data/ggcov-0.10/src/covio.C:123:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 48; data/ggcov-0.10/src/covio.C:124:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 40; data/ggcov-0.10/src/covio.C:125:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 32; data/ggcov-0.10/src/covio.C:127:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 24; data/ggcov-0.10/src/covio.C:128:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 16; data/ggcov-0.10/src/covio.C:129:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= ((uint64_t)fgetc(fp_) & 0xff) << 8; data/ggcov-0.10/src/covio.C:130:20: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). w |= (uint64_t)fgetc(fp_) & 0xff; data/ggcov-0.10/src/covio.C:192:6: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (fgetc(fp_) == EOF) data/ggcov-0.10/src/covio.C:201:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). covio_t::read(char *buf, unsigned int len) data/ggcov-0.10/src/covio.C:207:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). covio_t::read(estring &e, unsigned int len) data/ggcov-0.10/src/covio.C:223: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). e.truncate_to(ret ? strlen(e) : 0); data/ggcov-0.10/src/covio.H:129:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(char *buf, unsigned int len); data/ggcov-0.10/src/covio.H:130:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(estring &e, unsigned int len); data/ggcov-0.10/src/cpp_parser.C:613: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). for (end = buf+strlen(buf)-1 ; data/ggcov-0.10/src/demangle.c:108:30: [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 = (char *)buf.data() + strlen(buf.data()) - 1; data/ggcov-0.10/src/estring.C:45:20: [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). append_chars(str, strlen(str)); data/ggcov-0.10/src/estring.C:83: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). length_ += strlen(data_+length_); data/ggcov-0.10/src/estring.C:106:36: [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). replace_chars(start, len, str, strlen(str)); data/ggcov-0.10/src/estring.C:160:36: [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). replace_chars(start, len, str, strlen(str)); data/ggcov-0.10/src/estring.C:189:20: [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). replace_string(i, strlen(from), to); data/ggcov-0.10/src/estring.C:190:7: [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). i += strlen(to); data/ggcov-0.10/src/estring.C:306: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). int slen = strlen(s); data/ggcov-0.10/src/estring.H:61: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). length_ = strlen(s); data/ggcov-0.10/src/estring.H:92: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). length_ = strlen(s); data/ggcov-0.10/src/estring.H:160: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). length_ = strlen(s); data/ggcov-0.10/src/estringtest.c:31:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 5); data/ggcov-0.10/src/estringtest.c:51:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 12); data/ggcov-0.10/src/estringtest.c:71:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 3); data/ggcov-0.10/src/estringtest.c:92:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 6); data/ggcov-0.10/src/estringtest.c:118:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 12); data/ggcov-0.10/src/estringtest.c:133:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 13); data/ggcov-0.10/src/estringtest.c:142:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 10); data/ggcov-0.10/src/estringtest.c:151:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 17); data/ggcov-0.10/src/estringtest.c:173:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 19); data/ggcov-0.10/src/estringtest.c:188:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 13); data/ggcov-0.10/src/estringtest.c:197:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 11); data/ggcov-0.10/src/estringtest.c:206:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 26); data/ggcov-0.10/src/estringtest.c:224:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 15); data/ggcov-0.10/src/estringtest.c:233:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 15); data/ggcov-0.10/src/estringtest.c:240:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(p) == 15); data/ggcov-0.10/src/estringtest.c:254:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 25); data/ggcov-0.10/src/estringtest.c:265:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(p) == 25); data/ggcov-0.10/src/estringtest.c:297:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 3); data/ggcov-0.10/src/estringtest.c:304:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 7); data/ggcov-0.10/src/estringtest.c:319:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 1); data/ggcov-0.10/src/estringtest.c:326:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 2); data/ggcov-0.10/src/estringtest.c:333:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 3); data/ggcov-0.10/src/estringtest.c:349:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 4); data/ggcov-0.10/src/estringtest.c:356:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 11); data/ggcov-0.10/src/estringtest.c:371:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 3); data/ggcov-0.10/src/estringtest.c:378:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 8); data/ggcov-0.10/src/estringtest.c:393:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 3); data/ggcov-0.10/src/estringtest.c:400:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 8); data/ggcov-0.10/src/estringtest.c:413:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 40); data/ggcov-0.10/src/estringtest.c:423:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 38); data/ggcov-0.10/src/estringtest.c:431:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 33); data/ggcov-0.10/src/estringtest.c:439:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 30); data/ggcov-0.10/src/estringtest.c:447:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 29); data/ggcov-0.10/src/estringtest.c:455:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 31); data/ggcov-0.10/src/estringtest.c:463:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 37); data/ggcov-0.10/src/estringtest.c:482:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 20); data/ggcov-0.10/src/estringtest.c:494:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 17); data/ggcov-0.10/src/estringtest.c:503:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 16); data/ggcov-0.10/src/estringtest.c:512:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 16); data/ggcov-0.10/src/estringtest.c:521:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 12); data/ggcov-0.10/src/estringtest.c:530:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 9); data/ggcov-0.10/src/estringtest.c:538:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 0); data/ggcov-0.10/src/estringtest.c:559:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 16); data/ggcov-0.10/src/estringtest.c:563:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 0); data/ggcov-0.10/src/estringtest.c:598:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 16); data/ggcov-0.10/src/estringtest.c:602:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 0); data/ggcov-0.10/src/estringtest.c:616:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 9); data/ggcov-0.10/src/estringtest.c:632:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 22); data/ggcov-0.10/src/estringtest.c:658:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 0); data/ggcov-0.10/src/estringtest.c:671:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 15); data/ggcov-0.10/src/estringtest.c:685:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 16); data/ggcov-0.10/src/estringtest.c:699:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 0); data/ggcov-0.10/src/estringtest.c:712:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 21); data/ggcov-0.10/src/estringtest.c:735:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 24); data/ggcov-0.10/src/estringtest.c:744:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 24); data/ggcov-0.10/src/estringtest.c:758:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 10); data/ggcov-0.10/src/estringtest.c:765:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). check(strlen(e.data()) == 10); data/ggcov-0.10/src/fakepopt.c:119:12: [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). len = strlen(opt->longName); data/ggcov-0.10/src/filename.c:77:14: [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). oldlen = strlen(oldext); data/ggcov-0.10/src/filename.c:152:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(file) > strlen(path)) data/ggcov-0.10/src/filename.c:152: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). if (strlen(file) > strlen(path)) data/ggcov-0.10/src/filename.c:154: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). const char *tail = path + strlen(path) - strlen(file); data/ggcov-0.10/src/filename.c:154:46: [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). const char *tail = path + strlen(path) - strlen(file); data/ggcov-0.10/src/filename.c:496:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((nfrom = read(fdfrom, buf, sizeof(buf))) > 0) data/ggcov-0.10/src/filerec.C: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). char *end = buf + strlen(buf); data/ggcov-0.10/src/filerec.C:79:13: [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 (part + strlen(part) == end) data/ggcov-0.10/src/ggcov-html.c:125: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). p = buf+strlen(buf)-1; data/ggcov-0.10/src/ggcov-webdb.c:86:41: [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 dbt((char *)s, (s == 0 ? 0 : strlen(s))); data/ggcov-0.10/src/ggcov.c:64: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). len += sizeof(char*) + strlen(argv[i]) + 1/*trailing nul char*/; data/ggcov-0.10/src/ggcov.c:74:7: [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 += strlen(p) + 1; data/ggcov-0.10/src/lego_diagram.C:116: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). for (end = cpath + strlen(cpath) - 1 ; data/ggcov-0.10/src/libggcov/intercept.c:131:12: [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). len = strlen(flagdesc[i].name); data/ggcov-0.10/src/libggcov/intercept.c:233:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(filename); data/ggcov-0.10/src/libggcov/intercept.c:244:29: [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). prefix_len = (prefix ? strlen(prefix) : 0); data/ggcov-0.10/src/libggcov/intercept.c:266:15: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). old_umask = umask(new_umask); data/ggcov-0.10/src/libggcov/intercept.c:286:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(old_umask); data/ggcov-0.10/src/php_serializer.C:195:50: [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). buf_.append_printf("s:%u:\"%s\";", (unsigned)strlen(s), s); data/ggcov-0.10/src/report.C:369:19: [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). common_len_ = strlen(common_); data/ggcov-0.10/src/sourcewin.C:634:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = getc(fp)) == EOF) data/ggcov-0.10/src/sourcewin.C:752:3: [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(countbuf, " ######", sizeof(countbuf)); data/ggcov-0.10/src/sourcewin.C:1171:14: [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). length = strlen(contents); data/ggcov-0.10/src/string_var.H:106: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). return (data_ == 0 ? 0 : strlen(data_)); data/ggcov-0.10/src/testfw.C:126:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int n = read(fd, buf, len); data/ggcov-0.10/src/testfw.C:228: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). e = b + strlen(b); data/ggcov-0.10/src/testfw.C:397:32: [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). retry_write(status_pipe, buf, strlen(buf)); data/ggcov-0.10/src/testfw.C:489:19: [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). vsnprintf(buf+strlen(buf), sizeof(buf)-2-strlen(buf), fmt, args); data/ggcov-0.10/src/testfw.C:489:46: [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). vsnprintf(buf+strlen(buf), sizeof(buf)-2-strlen(buf), fmt, args); data/ggcov-0.10/src/testfw.C:492:5: [1] (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). Risk is low because the source is a constant character. strcat(buf, "\n"); data/ggcov-0.10/src/testfw.C:501:36: [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). retry_write(status_pipe, buf, strlen(buf)); data/ggcov-0.10/src/toktest.c:55:44: [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). const char *buf_end = (const char *)(x+strlen(x)+1); data/ggcov-0.10/src/ui.c:1122:8: [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). len = strlen(str); data/ggcov-0.10/src/uix.c:250: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(errmsg, "<unknown>", sizeof(errmsg)-1); ANALYSIS SUMMARY: Hits = 306 Lines analyzed = 39680 in approximately 0.97 seconds (40952 lines/second) Physical Source Lines of Code (SLOC) = 28673 Hits@level = [0] 205 [1] 149 [2] 130 [3] 5 [4] 20 [5] 2 Hits@level+ = [0+] 511 [1+] 306 [2+] 157 [3+] 27 [4+] 22 [5+] 2 Hits/KSLOC@level+ = [0+] 17.8216 [1+] 10.6721 [2+] 5.47553 [3+] 0.941652 [4+] 0.767272 [5+] 0.069752 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.