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/roct-thunk-interface-3.7.0+dfsg/include/hsakmt.h
Examining data/roct-thunk-interface-3.7.0+dfsg/include/hsakmttypes.h
Examining data/roct-thunk-interface-3.7.0+dfsg/include/linux/kfd_ioctl.h
Examining data/roct-thunk-interface-3.7.0+dfsg/src/debug.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/events.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/fmm.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/fmm.h
Examining data/roct-thunk-interface-3.7.0+dfsg/src/globals.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/libhsakmt.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/libhsakmt.h
Examining data/roct-thunk-interface-3.7.0+dfsg/src/memory.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/openclose.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/pci_ids.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/pci_ids.h
Examining data/roct-thunk-interface-3.7.0+dfsg/src/perfctr.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/pmc_table.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/pmc_table.h
Examining data/roct-thunk-interface-3.7.0+dfsg/src/queues.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/rbtree.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/rbtree.h
Examining data/roct-thunk-interface-3.7.0+dfsg/src/rbtree_amd.h
Examining data/roct-thunk-interface-3.7.0+dfsg/src/time.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/topology.c
Examining data/roct-thunk-interface-3.7.0+dfsg/src/version.c
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/include/amdp2ptest.h
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/include/asic_reg/gfx_7_2_d.h
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/include/asic_reg/gfx_7_2_enum.h
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/include/asic_reg/gfx_7_2_sh_mask.h
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/include/kfd_pm4_opcodes.h
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/include/pm4_pkt_struct_ai.h
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/include/pm4_pkt_struct_ci.h
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/include/pm4_pkt_struct_common.h
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/include/pm4_pkt_struct_nv.h
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/include/sdma_pkt_struct.h
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/AqlQueue.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/AqlQueue.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/BasePacket.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/BasePacket.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/BaseQueue.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/BaseQueue.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/Dispatch.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/Dispatch.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/GoogleTestExtension.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/GoogleTestExtension.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IndirectBuffer.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IndirectBuffer.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IsaGenerator.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IsaGenerator.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IsaGenerator_Gfx10.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IsaGenerator_Gfx10.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IsaGenerator_Gfx72.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IsaGenerator_Gfx72.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IsaGenerator_Gfx8.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IsaGenerator_Gfx8.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IsaGenerator_Gfx9.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IsaGenerator_Gfx9.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDBaseComponentTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDBaseComponentTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDCWSRTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDCWSRTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDDBGTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDDBGTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDEventTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDEventTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDEvictTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDEvictTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDExceptionTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDExceptionTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDGWSTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDGWSTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDGraphicsInterop.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDGraphicsInterop.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDHWSTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDHWSTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDIPCTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDIPCTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDLocalMemoryTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDLocalMemoryTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMemoryTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMemoryTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMultiProcessTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMultiProcessTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDOpenCloseKFDTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDOpenCloseKFDTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPMTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPMTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPerfCounters.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPerfCounters.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPerformanceTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDQMTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDQMTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDRASTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDRASTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTestFlags.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTestMain.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTestUtil.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTestUtil.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTestUtilQueue.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTestUtilQueue.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTopologyTest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTopologyTest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/LinuxOSWrapper.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/OSWrapper.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/PM4Packet.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/PM4Packet.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/PM4Queue.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/PM4Queue.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/RDMATest.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/RDMATest.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/RDMAUtil.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/RDMAUtil.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/SDMAPacket.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/SDMAPacket.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/SDMAQueue.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/SDMAQueue.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/XgmiOptimizedSDMAQueue.hpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/rdma/simple/app/rdma_test.cpp
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/rdma/simple/drv/amdp2ptest.c
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/rdma/simple/drv/amdp2ptest.h
Examining data/roct-thunk-interface-3.7.0+dfsg/tests/reopen/kmtreopen.c

FINAL RESULTS:

data/roct-thunk-interface-3.7.0+dfsg/src/libhsakmt.h:81:40:  [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.
	do { if (level <= hsakmt_debug_level) fprintf(stderr, fmt, ##__VA_ARGS__); } while (0)
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:338:6:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
	if (fscanf(fd, "%s", str) != 1) {
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:607:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
	while (sscanf(p += prog, "%s %llu\n%n", prop_name, &prop_val, &prog) == 2) {
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:669:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
	while (sscanf(p += prog, "%s %llu\n%n", prop_name, &prop_val, &prog) == 2) {
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:965:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
	while (sscanf(p += prog, "%s %llu\n%n", prop_name, &prop_val, &prog) == 2) {
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1134:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
	while (sscanf(p += prog, "%s %llu\n%n", prop_name, &prop_val, &prog) == 2) {
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1356:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
	while (sscanf(p += prog, "%s %llu\n%n", prop_name, &prop_val, &prog) == 2) {
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1453:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
	while (sscanf(p += prog, "%s %llu\n%n", prop_name, &prop_val, &prog) == 2) {
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:1440:10:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
# define vsnprintf _vsnprintf
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2144:12:  [4] (buffer) StrNCpy:
  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).
    posix::StrNCpy(clone, str, length);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2764:12:  [4] (buffer) StrNCpy:
  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).
    posix::StrNCpy(
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:3017:20:  [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.
  const int size = vsnprintf(buffer, kBufferSize, format, args);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:3021:20:  [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.
  const int size = vsnprintf(buffer, kBufferSize, format, args);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:3938:5:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vprintf(fmt, args);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:3957:3:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vprintf(fmt, args);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:3964:3:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vprintf(fmt, args);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8619:10:  [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.
# define snprintf _snprintf
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8619:19:  [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.
# define snprintf _snprintf
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8621:10:  [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.
# define snprintf _snprintf_s
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8623:10:  [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.
# define snprintf _snprintf
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8623:19:  [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.
# define snprintf _snprintf
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:2774:20:  [4] (buffer) StrNCpy:
  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).
inline const char* StrNCpy(char* dest, const char* src, size_t n) {
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:8213:5:  [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(\
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMemoryTest.cpp:1673:20:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
static inline void access(volatile void *sd, int size, int rw) {
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMemoryTest.cpp:1770:13:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
            access(bufs[i], bufSize, 1);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMemoryTest.cpp:1782:13:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
            access(bufs[i], bufSize, 0);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTopologyTest.cpp:173:29:  [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(string, sibling);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/LinuxOSWrapper.cpp:86:15:  [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.
    int ret = system("sudo pm-suspend");
data/roct-thunk-interface-3.7.0+dfsg/src/fmm.c:2127:17:  [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.
	disableCache = getenv("HSA_DISABLE_CACHE");
data/roct-thunk-interface-3.7.0+dfsg/src/fmm.c:2133:17:  [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.
	pagedUserptr = getenv("HSA_USERPTR_FOR_PAGED_MEM");
data/roct-thunk-interface-3.7.0+dfsg/src/fmm.c:2139:17:  [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.
	checkUserptr = getenv("HSA_CHECK_USERPTR");
data/roct-thunk-interface-3.7.0+dfsg/src/fmm.c:2145: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.
	reserveSvm = getenv("HSA_RESERVE_SVM");
data/roct-thunk-interface-3.7.0+dfsg/src/fmm.c:2149:18:  [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.
	guardPagesStr = getenv("HSA_SVM_GUARD_PAGES");
data/roct-thunk-interface-3.7.0+dfsg/src/openclose.c:125:11:  [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.
	envvar = getenv("HSAKMT_DEBUG_LEVEL");
data/roct-thunk-interface-3.7.0+dfsg/src/openclose.c:134:11:  [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.
	envvar = getenv("HSA_ZFB");
data/roct-thunk-interface-3.7.0+dfsg/src/openclose.c:142:11:  [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.
	envvar = getenv("HSA_FORCE_ASIC_TYPE");
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1040:12:  [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.
		envvar = getenv("HSA_OVERRIDE_GFX_VERSION");
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:700:37:  [3] (random) random:
  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.
void ShuffleRange(internal::Random* random, int begin, int end,
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:721:39:  [3] (random) random:
  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.
inline void Shuffle(internal::Random* random, std::vector<E>* v) {
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:722:16:  [3] (random) random:
  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.
  ShuffleRange(random, 0, static_cast<int>(v->size()), v);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:1172:21:  [3] (random) random:
  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.
  internal::Random* random() { return &random_; }
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:3767:47:  [3] (random) random:
  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.
void TestCase::ShuffleTests(internal::Random* random) {
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:3768:11:  [3] (random) random:
  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.
  Shuffle(random, &test_indices_);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:5531:7:  [3] (random) random:
  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.
      random()->Reseed(random_seed_);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:5802:16:  [3] (random) random:
  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.
  ShuffleRange(random(), 0, last_death_test_case_ + 1, &test_case_indices_);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:5805:16:  [3] (random) random:
  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.
  ShuffleRange(random(), last_death_test_case_ + 1,
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:5810:34:  [3] (random) random:
  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.
    test_cases_[i]->ShuffleTests(random());
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:2470:7:  [3] (misc) InitializeCriticalSection:
  Exceptions can be thrown in low-memory situations. Use
  InitializeCriticalSectionAndSpinCount instead.
    ::InitializeCriticalSection(&handle_);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:2480:7:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
    ::EnterCriticalSection(&handle_);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:2812:27:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  const char* const env = getenv(name);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:2815:10:  [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.
  return getenv(name);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:17994:39:  [3] (random) random:
  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.
  void ShuffleTests(internal::Random* random);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMemoryTest.cpp:1391:22:  [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 *hsaDebug = getenv("HSA_DEBUG");
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/LinuxOSWrapper.cpp:137:17:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        int c = getopt_long(argc, argv, "", long_options, &option_index);
data/roct-thunk-interface-3.7.0+dfsg/src/fmm.c:1758: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(process_apertures, args_old.process_apertures,
data/roct-thunk-interface-3.7.0+dfsg/src/fmm.c:1775: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 path[128];
data/roct-thunk-interface-3.7.0+dfsg/src/fmm.c:1789: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(path, "/dev/dri/renderD%d", minor);
data/roct-thunk-interface-3.7.0+dfsg/src/fmm.c:1790:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(path, O_RDWR | O_CLOEXEC);
data/roct-thunk-interface-3.7.0+dfsg/src/fmm.c:2361: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 *)gpu_mem[gpu_mem_id].mmio_aperture.base +
data/roct-thunk-interface-3.7.0+dfsg/src/fmm.c:2516: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(&obj->mapped_device_id_array
data/roct-thunk-interface-3.7.0+dfsg/src/libhsakmt.h:42: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.
extern char force_asic_name[HSA_PUBLIC_NAME_SIZE];
data/roct-thunk-interface-3.7.0+dfsg/src/openclose.c:127:17:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		debug_level = atoi(envvar);
data/roct-thunk-interface-3.7.0+dfsg/src/openclose.c:136:17:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		zfb_support = atoi(envvar);
data/roct-thunk-interface-3.7.0+dfsg/src/openclose.c:189:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		fd = open(kfd_device_name, O_RDWR | O_CLOEXEC);
data/roct-thunk-interface-3.7.0+dfsg/src/pci_ids.c:84:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	int fd = open(path, O_RDONLY, 0);
data/roct-thunk-interface-3.7.0+dfsg/src/pci_ids.c:163: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 needle[5] = { '\n' };
data/roct-thunk-interface-3.7.0+dfsg/src/pci_ids.c:223: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 needle[6] = { '\n', '\t' };
data/roct-thunk-interface-3.7.0+dfsg/src/pci_ids.c:264: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(buf, r.start, to_copy);
data/roct-thunk-interface-3.7.0+dfsg/src/pci_ids.c:277: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(buf, tmp, to_copy);
data/roct-thunk-interface-3.7.0+dfsg/src/perfctr.c:376:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		file = fopen("/sys/bus/event_source/devices/amd_iommu_0/type",
data/roct-thunk-interface-3.7.0+dfsg/src/perfctr.c:379: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).
			file = fopen(/* kernel 4.11 and older */
data/roct-thunk-interface-3.7.0+dfsg/src/pmc_table.c:1986: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 path[256];
data/roct-thunk-interface-3.7.0+dfsg/src/pmc_table.c:1990: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 counter_id[max_counter_id + 1];
data/roct-thunk-interface-3.7.0+dfsg/src/pmc_table.c:2017:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		file = fopen(path, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/pmc_table.c:2059:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	file = fopen(path, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/queues.c:791: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(q->cu_mask, QueueCUMask, CUMaskCount / 8);
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:88: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 force_asic_name[HSA_PUBLIC_NAME_SIZE];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:244: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 model_name[HSA_PUBLIC_NAME_SIZE]; /* model name */
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:310:7:  [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).
	fd = fopen(file, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:333:7:  [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).
	fd = fopen(file, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:358:7:  [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).
	fd = fopen(file, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:440: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 path[256], str[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:505:7:  [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).
	fd = fopen(KFD_SYSFS_PATH_GENERATION_ID, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:530: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 path[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:535:7:  [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).
	fd = fopen(path, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:559: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 prop_name[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:560: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 path[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:587:7:  [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).
	fd = fopen(path, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:635: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 prop_name[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:645:7:  [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).
	fd = fopen(KFD_SYSFS_PATH_SYSTEM_PROPERTIES, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:830: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 read_buf[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:841:7:  [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).
	fd = fopen(proc_cpuinfo_path, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:859: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).
			proc = atoi(p);
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:896:27:  [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).
			cpuinfo[proc].apicid = atoi(p);
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:918: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 prop_name[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:919: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 path[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:924: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 namebuf[HSA_PUBLIC_NAME_SIZE];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:945:7:  [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).
	fd = fopen(path, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1098: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 prop_name[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1099: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 path[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1112:7:  [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).
	fd = fopen(path, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1194: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 path[MAXPATHSIZE], node_dir[MAXPATHSIZE];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1252:24:  [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).
		this_cpu->proc_num = atoi(p);
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1300: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(&tbl->cache[cache_cnt++],
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1320: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 prop_name[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1321: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 path[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1334:7:  [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).
	fd = fopen(path, "r");
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1417: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 prop_name[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1418: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 path[256];
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1431:7:  [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).
	fd = fopen(path, "r");
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2167:7:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
      MultiByteToWideChar(CP_ACP, 0, ansi, length,
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2170:3:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
  MultiByteToWideChar(CP_ACP, 0, ansi, length,
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2658: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 error_text[kBufSize] = { '\0' };
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2826: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 buffer[32];  // CodePointToUtf8 requires a buffer this big.
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:3008: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 buffer[4096];
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:6483: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 buffer[256];
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:6902: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 executable_path[_MAX_PATH + 1];  // NOLINT
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:7548: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 cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:7551: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 cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8232: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(buffer, regex, len);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8310: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 temp_dir_path[MAX_PATH + 1] = { '\0' };  // NOLINT
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8311: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 temp_file_path[MAX_PATH + 1] = { '\0' };  // NOLINT
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8329:29:  [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).
    const int captured_fd = mkstemp(name_template);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8629: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 text[5] = "";
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:2786:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  return fopen(path, mode);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:3257: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(str, buffer, a_length);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/BaseQueue.cpp:164:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(m_pendingWptr + m_QueueBuf->As<unsigned int*>(), packet.GetPacket(), packetSizeInDwords * 4);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/IndirectBuffer.cpp:47:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(m_IndirectBuf->As<unsigned int*>() + writePtr , packet.GetPacket(),  packet.SizeInBytes());
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDDBGTest.cpp:716:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char fifoBuf[kMaxSize];
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDGraphicsInterop.cpp:75: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(meta.umd_metadata, metadata, metadata_size);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDIPCTest.cpp:471: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 msg[16];
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMemoryTest.cpp:942: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 *memTypeStrings[2] = {"SysMem", "VRAM"};
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMemoryTest.cpp:1235: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 userData[16] = "This is a test.";
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMemoryTest.cpp:1676: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 dummy[1024];
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMemoryTest.cpp:1698: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 *memTypeStrings[nMemTypes] = {"SysMem", "VRAM"};
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMemoryTest.cpp:1764:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(bufs[i], tmp, bufSize);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDMemoryTest.cpp:1776:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(tmp, bufs[i], bufSize);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPerfCounters.cpp:43: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 name[32];
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPerfCounters.cpp:113: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 uuid_string[37] = "";
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPerfCounters.cpp:114: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 name[32] = "";
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPerfCounters.cpp:117: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 type[32];
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPerformanceTest.cpp:175: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 *test_suits_string[total_tests] = {
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPerformanceTest.cpp:201:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[64];
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPerformanceTest.cpp:276:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char str[64];
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDPerformanceTest.cpp:328: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 *test_suits_string[total_tests] = {
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDQMTest.cpp:414:19:  [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 progressSteps[4] = {'-', '\\', '|', '/'};
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDQMTest.cpp:430:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(srcBuf.As<char *>()+PAGE_SIZE, srcBuf.As<char *>(), 1024);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDQMTest.cpp:1298: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 *fs[skip] = {"1st", "2nd"};
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDRASTest.cpp:40: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 path[256], name[128], tmp[128];
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDRASTest.cpp:71:17:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    pDriMinor = fopen(path, "r");
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDRASTest.cpp:84:23:  [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).
        pDriPrimary = fopen(path, "r");
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDRASTest.cpp:102: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).
    m_pFile = fopen(path, "w");
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTestUtil.cpp:53:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = fopen(file, "r");
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTopologyTest.cpp:168: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 string[1024] = "";
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTopologyTest.cpp:169: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 sibling[5] = "";
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDTopologyTest.cpp:172:29:  [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(sibling, "%d,", i);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/LinuxOSWrapper.cpp:184:31:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                int timeOut = atoi(optarg);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/LinuxOSWrapper.cpp:191:30:  [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).
                int nodeId = atoi(optarg);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/LinuxOSWrapper.cpp:198:33:  [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).
                int dstNodeId = atoi(optarg);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/PM4Packet.cpp:67:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(m_pPacketData->data, data, m_ndw * sizeof(uint32_t));
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/PM4Packet.cpp:325:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(m_pPacketData->reg_data, regValues, numRegs*sizeof(uint32_t));
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/RDMAUtil.cpp:37:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open(AMDP2PTEST_DEVICE_PATH, O_RDWR);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/SDMAPacket.cpp:62: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(&packetData->DATA0_UNION.DW_4_DATA, data, ndw*sizeof(unsigned int));
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/SDMAPacket.cpp:78: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(dst, dsts, sizeof(void*) * n);
data/roct-thunk-interface-3.7.0+dfsg/tests/rdma/simple/app/rdma_test.cpp:40: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).
    rdma_fd = open(AMDP2PTEST_DEVICE_PATH, O_RDWR);
data/roct-thunk-interface-3.7.0+dfsg/src/openclose.c:146:8:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
		if ((sscanf(envvar, "%u.%u.%u %u %63s %u", &major, &minor, &step,
data/roct-thunk-interface-3.7.0+dfsg/src/perfctr.c:102:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		bytes = read(fd, buf, left);
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:282: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).
	int prefix_len = strlen(prefix);
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:405: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).
	num_hexs = (strlen(shared_cpu_map) + 8) / 9; /* 8 characters + "," */
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:797:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy((char *)props->AMDName, cpuinfo->model_name, sizeof(props->AMDName));
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:882: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).
			p_len = strlen(p);
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:885:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(cpuinfo[proc].model_name, p, p_len - 1);
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:888:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(cpuinfo[proc].model_name, p, HSA_PUBLIC_NAME_SIZE);
data/roct-thunk-interface-3.7.0+dfsg/src/topology.c:1066:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy((char *)props->AMDName, hsa_gfxip->amd_name, sizeof(props->AMDName)-1);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2155:47:  [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).
                    NULL : CloneString(c_str, strlen(c_str));
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2165:22:  [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 int length = strlen(ansi);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2810:34:  [1] (buffer) wcslen:
  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).
    num_chars = static_cast<int>(wcslen(str));
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2975: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).
  const size_t this_len = strlen(c_str());
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2976: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/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2988: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).
  const size_t this_len = strlen(c_str());
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:2989: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/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:4517: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).
      segment = next_segment + strlen("]]>");
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:4746: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).
  result.reserve(strlen(str) + 1);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:5863: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/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:7966:33:  [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 full_regex_len = strlen(regex) + 10;
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8220:22:  [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 len = strlen(regex);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8868: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).
    PrintCharsAsStringTo(s, strlen(s), os);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest-all.cpp:8885:33:  [1] (buffer) wcslen:
  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).
    PrintWideCharsAsStringTo(s, wcslen(s), os);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:2775:10:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  return strncpy(dest, src, n);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:2797:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  return static_cast<int>(read(fd, buf, count));
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/gtest-1.6.0/gtest/gtest.h:3153:33:  [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).
      ConstructNonNull(a_c_str, strlen(a_c_str));
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDDBGTest.cpp:496:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ASSERT_GT(read(PollFd, &trapChar, 1), 0);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDDBGTest.cpp:717:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            childStatus = read(PollFd, fifoBuf, 1) == -1\
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDDBGTest.cpp:776:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            childStatus = read(PollFd, fifoBuf, kMaxSize) == -1
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDGraphicsInterop.cpp:46: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).
    unsigned metadata_size = strlen(metadata)+1;
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDIPCTest.cpp:81:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ASSERT_GE(read(pipefd[0], reinterpret_cast<void*>(&sharedHandleLM), sizeof(sharedHandleLM)), 0);
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/KFDIPCTest.cpp:423:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        cur_bytes = read(fd, ptr, (size - total_bytes));
data/roct-thunk-interface-3.7.0+dfsg/tests/kfdtest/src/LinuxOSWrapper.cpp:53:5:  [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(delayCount * 1000);

ANALYSIS SUMMARY:

Hits = 198
Lines analyzed = 91587 in approximately 2.01 seconds (45462 lines/second)
Physical Source Lines of Code (SLOC) = 68557
Hits@level = [0] 164 [1]  33 [2] 111 [3]  26 [4]  28 [5]   0
Hits@level+ = [0+] 362 [1+] 198 [2+] 165 [3+]  54 [4+]  28 [5+]   0
Hits/KSLOC@level+ = [0+] 5.28028 [1+] 2.88811 [2+] 2.40676 [3+] 0.787666 [4+] 0.408419 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.