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/heaptrack-1.2.0/3rdparty/boost-zstd/zstd.cpp
Examining data/heaptrack-1.2.0/3rdparty/boost-zstd/zstd.hpp
Examining data/heaptrack-1.2.0/3rdparty/catch.hpp
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/alloc.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/atomic.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/auxincl/dwarf2.h
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/auxincl/filenames.h
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/backtrace.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/backtrace.h
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/fileline.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/internal.h
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/mmap.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/mmapio.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/nounwind.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/posix.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/print.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/read.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/simple.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/sort.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/state.c
Examining data/heaptrack-1.2.0/3rdparty/libbacktrace/unknown.c
Examining data/heaptrack-1.2.0/src/analyze/accumulatedtracedata.cpp
Examining data/heaptrack-1.2.0/src/analyze/accumulatedtracedata.h
Examining data/heaptrack-1.2.0/src/analyze/allocationdata.h
Examining data/heaptrack-1.2.0/src/analyze/gui/callercalleemodel.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/callercalleemodel.h
Examining data/heaptrack-1.2.0/src/analyze/gui/chartmodel.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/chartmodel.h
Examining data/heaptrack-1.2.0/src/analyze/gui/chartproxy.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/chartproxy.h
Examining data/heaptrack-1.2.0/src/analyze/gui/chartwidget.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/chartwidget.h
Examining data/heaptrack-1.2.0/src/analyze/gui/costdelegate.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/costdelegate.h
Examining data/heaptrack-1.2.0/src/analyze/gui/flamegraph.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/flamegraph.h
Examining data/heaptrack-1.2.0/src/analyze/gui/gui.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/hashmodel.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/hashmodel.h
Examining data/heaptrack-1.2.0/src/analyze/gui/histogrammodel.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/histogrammodel.h
Examining data/heaptrack-1.2.0/src/analyze/gui/histogramwidget.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/histogramwidget.h
Examining data/heaptrack-1.2.0/src/analyze/gui/locationdata.h
Examining data/heaptrack-1.2.0/src/analyze/gui/mainwindow.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/mainwindow.h
Examining data/heaptrack-1.2.0/src/analyze/gui/parser.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/parser.h
Examining data/heaptrack-1.2.0/src/analyze/gui/stacksmodel.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/stacksmodel.h
Examining data/heaptrack-1.2.0/src/analyze/gui/summarydata.h
Examining data/heaptrack-1.2.0/src/analyze/gui/topproxy.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/topproxy.h
Examining data/heaptrack-1.2.0/src/analyze/gui/treemodel.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/treemodel.h
Examining data/heaptrack-1.2.0/src/analyze/gui/treeproxy.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/treeproxy.h
Examining data/heaptrack-1.2.0/src/analyze/gui/util.cpp
Examining data/heaptrack-1.2.0/src/analyze/gui/util.h
Examining data/heaptrack-1.2.0/src/analyze/print/heaptrack_print.cpp
Examining data/heaptrack-1.2.0/src/interpret/heaptrack_interpret.cpp
Examining data/heaptrack-1.2.0/src/track/heaptrack_api.h
Examining data/heaptrack-1.2.0/src/track/heaptrack_inject.cpp
Examining data/heaptrack-1.2.0/src/track/heaptrack_preload.cpp
Examining data/heaptrack-1.2.0/src/track/libheaptrack.cpp
Examining data/heaptrack-1.2.0/src/track/libheaptrack.h
Examining data/heaptrack-1.2.0/src/track/trace.h
Examining data/heaptrack-1.2.0/src/track/trace_libunwind.cpp
Examining data/heaptrack-1.2.0/src/track/trace_unwind_tables.cpp
Examining data/heaptrack-1.2.0/src/track/tracetree.h
Examining data/heaptrack-1.2.0/src/util/indices.h
Examining data/heaptrack-1.2.0/src/util/linereader.h
Examining data/heaptrack-1.2.0/src/util/linewriter.h
Examining data/heaptrack-1.2.0/src/util/pointermap.h
Examining data/heaptrack-1.2.0/tests/auto/tempfile.h
Examining data/heaptrack-1.2.0/tests/auto/tst_inject.cpp
Examining data/heaptrack-1.2.0/tests/auto/tst_io.cpp
Examining data/heaptrack-1.2.0/tests/auto/tst_libheaptrack.cpp
Examining data/heaptrack-1.2.0/tests/auto/tst_parser.cpp
Examining data/heaptrack-1.2.0/tests/auto/tst_trace.cpp
Examining data/heaptrack-1.2.0/tests/benchmarks/bench_parser.cpp
Examining data/heaptrack-1.2.0/tests/benchmarks/bench_pointerhash.cpp
Examining data/heaptrack-1.2.0/tests/benchmarks/bench_pointermap.cpp
Examining data/heaptrack-1.2.0/tests/benchmarks/bench_pointers.h
Examining data/heaptrack-1.2.0/tests/benchmarks/measure_malloc_overhead.cpp
Examining data/heaptrack-1.2.0/tests/benchutil.h
Examining data/heaptrack-1.2.0/tests/manual/callgraph.cpp
Examining data/heaptrack-1.2.0/tests/manual/inlining.cpp
Examining data/heaptrack-1.2.0/tests/manual/lib.cpp
Examining data/heaptrack-1.2.0/tests/manual/lib.h
Examining data/heaptrack-1.2.0/tests/manual/libc_leaks.c
Examining data/heaptrack-1.2.0/tests/manual/peak.c
Examining data/heaptrack-1.2.0/tests/manual/signals.cpp
Examining data/heaptrack-1.2.0/tests/manual/test.c
Examining data/heaptrack-1.2.0/tests/manual/test.cpp
Examining data/heaptrack-1.2.0/tests/manual/test_aggregation.cpp
Examining data/heaptrack-1.2.0/tests/manual/test_lib.cpp
Examining data/heaptrack-1.2.0/tests/manual/test_linkage.c
Examining data/heaptrack-1.2.0/tests/manual/threaded.cpp

FINAL RESULTS:

data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:110:9:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
#define readlink xreadlink
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:763:12:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
      rl = readlink (filename, buf, len);
data/heaptrack-1.2.0/src/track/libheaptrack.cpp:383:24:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
        ssize_t size = readlink("/proc/self/exe", buf, BUF_SIZE);
data/heaptrack-1.2.0/src/analyze/gui/chartwidget.cpp:71:33:  [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.
        KFormat format(QLocale::system());
data/heaptrack-1.2.0/src/analyze/gui/histogramwidget.cpp:55:33:  [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.
        KFormat format(QLocale::system());
data/heaptrack-1.2.0/src/track/libheaptrack.cpp:133:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        fprintf(stderr, fmt, args...);
data/heaptrack-1.2.0/src/util/linewriter.h:73:23:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            int ret = snprintf(out(), available, fmt, args...);
data/heaptrack-1.2.0/3rdparty/catch.hpp:5662:22:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
                std::srand( m_configData.rngSeed );
data/heaptrack-1.2.0/src/analyze/print/heaptrack_print.cpp:109:12:  [3] (random) setstate:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
        in.setstate(std::ios_base::failbit);
data/heaptrack-1.2.0/src/track/heaptrack_preload.cpp:144:20:  [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.
    heaptrack_init(getenv("DUMP_HEAPTRACK_OUTPUT"),
data/heaptrack-1.2.0/tests/benchmarks/bench_pointers.h:49:9:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
        srand(0);
data/heaptrack-1.2.0/tests/manual/test.c:27:5:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    srand(0);
data/heaptrack-1.2.0/3rdparty/catch.hpp:1116:23:  [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.
    struct TrueType { char sizer[1]; };
data/heaptrack-1.2.0/3rdparty/catch.hpp:1117:24:  [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.
    struct FalseType { char sizer[2]; };
data/heaptrack-1.2.0/3rdparty/catch.hpp:2494: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 storage[sizeof(T)];
data/heaptrack-1.2.0/3rdparty/catch.hpp:5563:23:  [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).
                m_ofs.open( m_config->getFilename().c_str() );
data/heaptrack-1.2.0/3rdparty/catch.hpp:6072: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 data[bufferSize];
data/heaptrack-1.2.0/3rdparty/catch.hpp:7217:21:  [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 asChar[sizeof (int)];
data/heaptrack-1.2.0/3rdparty/catch.hpp:7782:16:  [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 line[CATCH_CONFIG_CONSOLE_WIDTH] = {0};
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:376:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char b[200];
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:1723:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	  memcpy (s, dir, dir_len);
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:1728:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	  memcpy (s + dir_len + 1, filename, filename_len + 1);
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:1846:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		    memcpy (p, dir, dir_len);
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:1852:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		    memcpy (p + dir_len + 1, f, f_len + 1);
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:2813:8:  [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 (s, dir, dir_len);
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:2816:8:  [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 (s + dir_len + 1, filename, filename_len + 1);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:209:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char	e_ident[EI_NIDENT];	/* ELF "magic number" */
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:305:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char name[1];
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:356: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 * const debug_section_names[DEBUG_MAX] =
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:809: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 (t, prefix, prefix_len);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:824: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 (t, suffix, suffix_len);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:860: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 (try, prefix, prefix_len);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:861: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 (try + prefix_len, prefix2, prefix2_len);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:862: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 (try + prefix_len + prefix2_len, debuglink_name, debuglink_len);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:923:8:  [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 (c, filename, slash - filename);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:924:8:  [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 (c + (slash - filename), new_buf, strlen (new_buf));
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:1465: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.
static unsigned char codes[287];
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:1686:8:  [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 (pout, pin, len);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:1712: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.
	      unsigned char codebits[19];
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:2223: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 (pout, pout - dist, len);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:2233:10:  [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 (pout, pout - dist, copy);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:2597: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 (&ehdr, ehdr_view.data, sizeof ehdr);
data/heaptrack-1.2.0/3rdparty/libbacktrace/fileline.c:62:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[64];
data/heaptrack-1.2.0/3rdparty/libbacktrace/mmap.c:249:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	  memcpy (base, vec->base, vec->size);
data/heaptrack-1.2.0/3rdparty/libbacktrace/posix.c:67: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).
  descriptor = open (filename, (int) (O_RDONLY | O_BINARY | O_CLOEXEC));
data/heaptrack-1.2.0/src/analyze/gui/mainwindow.cpp:528:37:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    m_openAction = KStandardAction::open(this, SLOT(closeFile()), this);
data/heaptrack-1.2.0/src/analyze/print/heaptrack_print.cpp:654:24:  [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).
        data.massifOut.open(printMassif, ios_base::out);
data/heaptrack-1.2.0/src/track/heaptrack_preload.cpp:108: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[MAX_SIZE] = {0};
data/heaptrack-1.2.0/src/track/libheaptrack.cpp:183: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).
    auto out = open(outputFileName.c_str(), O_CREAT | O_WRONLY | O_CLOEXEC, 0644);
data/heaptrack-1.2.0/src/track/libheaptrack.cpp:349: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 buf[BUF_SIZE + 1];
data/heaptrack-1.2.0/src/track/libheaptrack.cpp:382: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 buf[BUF_SIZE + 1];
data/heaptrack-1.2.0/src/track/libheaptrack.cpp:394: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 buf[BUF_SIZE + 1];
data/heaptrack-1.2.0/src/track/libheaptrack.cpp:395: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).
        auto fd = open("/proc/self/cmdline", O_RDONLY);
data/heaptrack-1.2.0/src/track/libheaptrack.cpp:558:25:  [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).
            procStatm = open("/proc/self/statm", O_RDONLY);
data/heaptrack-1.2.0/src/track/trace_libunwind.cpp:50: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 symbol[256] = {"<unknown>"};
data/heaptrack-1.2.0/src/util/linewriter.h:130: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(out(), line.c_str(), length);
data/heaptrack-1.2.0/src/util/linewriter.h:213:25:  [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.
        constexpr const char hexChars[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
data/heaptrack-1.2.0/tests/auto/tempfile.h:43: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).
    bool open()
data/heaptrack-1.2.0/tests/auto/tempfile.h:45: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).
        fd = ::open(fileName.c_str(), O_CREAT | O_CLOEXEC | O_RDWR, 0644);
data/heaptrack-1.2.0/tests/auto/tst_io.cpp:37:18:  [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).
    REQUIRE(file.open());
data/heaptrack-1.2.0/tests/auto/tst_io.cpp:62:18:  [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).
    REQUIRE(file.open());
data/heaptrack-1.2.0/tests/auto/tst_io.cpp:89:18:  [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).
    REQUIRE(file.open());
data/heaptrack-1.2.0/tests/auto/tst_io.cpp:106:18:  [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).
    REQUIRE(file.open());
data/heaptrack-1.2.0/tests/manual/libc_leaks.c:27: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[16];
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:1716: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).
	  dir_len = strlen (dir);
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:1717: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).
	  filename_len = strlen (filename);
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:1838: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).
		    dir_len = strlen (dir);
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:1839:15:  [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).
		    f_len = strlen (f);
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:2803: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).
	      filename_len = strlen (filename);
data/heaptrack-1.2.0/3rdparty/libbacktrace/dwarf.c:2805:18:  [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).
	      dir_len = strlen (dir);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:793: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).
  const size_t prefix_len = strlen (prefix);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:795: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).
  const size_t suffix_len = strlen (suffix);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:854: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).
  debuglink_len = strlen (debuglink_name);
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:918:34:  [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).
	      clen = slash - filename + strlen (new_buf) + 1;
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:924:49:  [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).
	      memcpy (c + (slash - filename), new_buf, strlen (new_buf));
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:925: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).
	      c[slash - filename + strlen (new_buf)] = '\0';
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:965: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).
				   strlen (".debug/"), debuglink_name,
data/heaptrack-1.2.0/3rdparty/libbacktrace/elf.c:976: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).
				   strlen ("/usr/lib/debug/"), prefix,
data/heaptrack-1.2.0/3rdparty/libbacktrace/read.c:67:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  got = read (descriptor, view->base, size);
data/heaptrack-1.2.0/src/analyze/accumulatedtracedata.cpp:124:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
bool AccumulatedTraceData::read(const string& inputFile)
data/heaptrack-1.2.0/src/analyze/accumulatedtracedata.cpp:127:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        return read(inputFile, FirstPass) && read(inputFile, SecondPass);
data/heaptrack-1.2.0/src/analyze/accumulatedtracedata.cpp:127:46:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        return read(inputFile, FirstPass) && read(inputFile, SecondPass);
data/heaptrack-1.2.0/src/analyze/accumulatedtracedata.cpp:129:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        return read(inputFile, ThirdPass);
data/heaptrack-1.2.0/src/analyze/accumulatedtracedata.cpp:133:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
bool AccumulatedTraceData::read(const string& inputFile, const ParsePass pass)
data/heaptrack-1.2.0/src/analyze/accumulatedtracedata.cpp:158:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    return read(in, pass);
data/heaptrack-1.2.0/src/analyze/accumulatedtracedata.cpp:161:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
data/heaptrack-1.2.0/src/analyze/accumulatedtracedata.h:112:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    bool read(const std::string& inputFile);
data/heaptrack-1.2.0/src/analyze/accumulatedtracedata.h:122:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    bool read(const std::string& inputFile, const ParsePass pass);
data/heaptrack-1.2.0/src/analyze/accumulatedtracedata.h:123:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    bool read(std::istream& in, const ParsePass pass);
data/heaptrack-1.2.0/src/analyze/gui/parser.cpp:611:80:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                async(launch::async, [&diffData, diffBase]() { return diffData.read(diffBase.toStdString()); });
data/heaptrack-1.2.0/src/analyze/gui/parser.cpp:612:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (!data->read(stdPath)) {
data/heaptrack-1.2.0/src/analyze/gui/parser.cpp:622:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        } else if (!data->read(stdPath)) {
data/heaptrack-1.2.0/src/analyze/gui/parser.cpp:660:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                data->read(stdPath);
data/heaptrack-1.2.0/src/analyze/print/heaptrack_print.cpp:672:88:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        auto diffRead = async(launch::async, [&diffData, diffFile]() { return diffData.read(diffFile); });
data/heaptrack-1.2.0/src/analyze/print/heaptrack_print.cpp:674:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (!data.read(inputFile) || !diffRead.get()) {
data/heaptrack-1.2.0/src/analyze/print/heaptrack_print.cpp:679:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    } else if (!data.read(inputFile)) {
data/heaptrack-1.2.0/src/track/libheaptrack.cpp:350:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (read(s_data->procStatm, buf, BUF_SIZE) <= 0) {
data/heaptrack-1.2.0/src/track/libheaptrack.cpp:396:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        int bytesRead = read(fd, buf, BUF_SIZE);
data/heaptrack-1.2.0/tests/manual/signals.cpp:92:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(1000 * 1000);
data/heaptrack-1.2.0/tests/manual/test.c:31:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(100);
data/heaptrack-1.2.0/tests/manual/test_linkage.c:92:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(200);
data/heaptrack-1.2.0/tests/manual/test_linkage.c:98:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(200);

ANALYSIS SUMMARY:

Hits = 102
Lines analyzed = 30914 in approximately 0.73 seconds (42403 lines/second)
Physical Source Lines of Code (SLOC) = 22472
Hits@level = [0]  43 [1]  38 [2]  52 [3]   5 [4]   4 [5]   3
Hits@level+ = [0+] 145 [1+] 102 [2+]  64 [3+]  12 [4+]   7 [5+]   3
Hits/KSLOC@level+ = [0+] 6.45247 [1+] 4.53898 [2+] 2.84799 [3+] 0.533998 [4+] 0.311499 [5+] 0.133499
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.