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/kvmtool-0.20170904/ioeventfd.c
Examining data/kvmtool-0.20170904/guest/init.c
Examining data/kvmtool-0.20170904/builtin-version.c
Examining data/kvmtool-0.20170904/kvm-cpu.c
Examining data/kvmtool-0.20170904/main.c
Examining data/kvmtool-0.20170904/guest_compat.c
Examining data/kvmtool-0.20170904/builtin-help.c
Examining data/kvmtool-0.20170904/builtin-stop.c
Examining data/kvmtool-0.20170904/hw/vesa.c
Examining data/kvmtool-0.20170904/hw/pci-shmem.c
Examining data/kvmtool-0.20170904/hw/serial.c
Examining data/kvmtool-0.20170904/hw/i8042.c
Examining data/kvmtool-0.20170904/hw/rtc.c
Examining data/kvmtool-0.20170904/pci.c
Examining data/kvmtool-0.20170904/kvm.c
Examining data/kvmtool-0.20170904/ui/vnc.c
Examining data/kvmtool-0.20170904/ui/sdl.c
Examining data/kvmtool-0.20170904/ui/gtk3.c
Examining data/kvmtool-0.20170904/builtin-pause.c
Examining data/kvmtool-0.20170904/kvm-cmd.c
Examining data/kvmtool-0.20170904/devices.c
Examining data/kvmtool-0.20170904/code16gcc.h
Examining data/kvmtool-0.20170904/x86/kvm-cpu.c
Examining data/kvmtool-0.20170904/x86/kvm.c
Examining data/kvmtool-0.20170904/x86/include/asm/processor-flags.h
Examining data/kvmtool-0.20170904/x86/include/asm/apicdef.h
Examining data/kvmtool-0.20170904/x86/include/asm/mpspec_def.h
Examining data/kvmtool-0.20170904/x86/include/asm/bios/vesa.h
Examining data/kvmtool-0.20170904/x86/include/asm/bios/types.h
Examining data/kvmtool-0.20170904/x86/include/asm/bios/memcpy.h
Examining data/kvmtool-0.20170904/x86/include/asm/kvm.h
Examining data/kvmtool-0.20170904/x86/include/kvm/interrupt.h
Examining data/kvmtool-0.20170904/x86/include/kvm/kvm-config-arch.h
Examining data/kvmtool-0.20170904/x86/include/kvm/assembly.h
Examining data/kvmtool-0.20170904/x86/include/kvm/kvm-arch.h
Examining data/kvmtool-0.20170904/x86/include/kvm/barrier.h
Examining data/kvmtool-0.20170904/x86/include/kvm/bios-export.h
Examining data/kvmtool-0.20170904/x86/include/kvm/cpufeature.h
Examining data/kvmtool-0.20170904/x86/include/kvm/mptable.h
Examining data/kvmtool-0.20170904/x86/include/kvm/boot-protocol.h
Examining data/kvmtool-0.20170904/x86/include/kvm/fdt-arch.h
Examining data/kvmtool-0.20170904/x86/include/kvm/bios.h
Examining data/kvmtool-0.20170904/x86/include/kvm/e820.h
Examining data/kvmtool-0.20170904/x86/include/kvm/kvm-cpu-arch.h
Examining data/kvmtool-0.20170904/x86/cpuid.c
Examining data/kvmtool-0.20170904/x86/ioport.c
Examining data/kvmtool-0.20170904/x86/boot.c
Examining data/kvmtool-0.20170904/x86/irq.c
Examining data/kvmtool-0.20170904/x86/bios.c
Examining data/kvmtool-0.20170904/x86/interrupt.c
Examining data/kvmtool-0.20170904/x86/bios/int10.c
Examining data/kvmtool-0.20170904/x86/bios/int15.c
Examining data/kvmtool-0.20170904/x86/bios/memcpy.c
Examining data/kvmtool-0.20170904/x86/bios/e820.c
Examining data/kvmtool-0.20170904/x86/mptable.c
Examining data/kvmtool-0.20170904/net/uip/csum.c
Examining data/kvmtool-0.20170904/net/uip/icmp.c
Examining data/kvmtool-0.20170904/net/uip/udp.c
Examining data/kvmtool-0.20170904/net/uip/core.c
Examining data/kvmtool-0.20170904/net/uip/ipv4.c
Examining data/kvmtool-0.20170904/net/uip/arp.c
Examining data/kvmtool-0.20170904/net/uip/tcp.c
Examining data/kvmtool-0.20170904/net/uip/buf.c
Examining data/kvmtool-0.20170904/net/uip/dhcp.c
Examining data/kvmtool-0.20170904/tests/boot/init.c
Examining data/kvmtool-0.20170904/include/asm/hweight.h
Examining data/kvmtool-0.20170904/include/common-cmds.h
Examining data/kvmtool-0.20170904/include/kvm/builtin-balloon.h
Examining data/kvmtool-0.20170904/include/kvm/rtc.h
Examining data/kvmtool-0.20170904/include/kvm/builtin-sandbox.h
Examining data/kvmtool-0.20170904/include/kvm/builtin-pause.h
Examining data/kvmtool-0.20170904/include/kvm/sdl.h
Examining data/kvmtool-0.20170904/include/kvm/ioport.h
Examining data/kvmtool-0.20170904/include/kvm/pci.h
Examining data/kvmtool-0.20170904/include/kvm/threadpool.h
Examining data/kvmtool-0.20170904/include/kvm/i8042.h
Examining data/kvmtool-0.20170904/include/kvm/framebuffer.h
Examining data/kvmtool-0.20170904/include/kvm/virtio-pci-dev.h
Examining data/kvmtool-0.20170904/include/kvm/mutex.h
Examining data/kvmtool-0.20170904/include/kvm/guest_compat.h
Examining data/kvmtool-0.20170904/include/kvm/virtio-mmio.h
Examining data/kvmtool-0.20170904/include/kvm/devices.h
Examining data/kvmtool-0.20170904/include/kvm/builtin-stop.h
Examining data/kvmtool-0.20170904/include/kvm/kvm-ipc.h
Examining data/kvmtool-0.20170904/include/kvm/compiler.h
Examining data/kvmtool-0.20170904/include/kvm/apic.h
Examining data/kvmtool-0.20170904/include/kvm/term.h
Examining data/kvmtool-0.20170904/include/kvm/irq.h
Examining data/kvmtool-0.20170904/include/kvm/kvm-cmd.h
Examining data/kvmtool-0.20170904/include/kvm/pci-shmem.h
Examining data/kvmtool-0.20170904/include/kvm/rbtree-interval.h
Examining data/kvmtool-0.20170904/include/kvm/builtin-run.h
Examining data/kvmtool-0.20170904/include/kvm/virtio-9p.h
Examining data/kvmtool-0.20170904/include/kvm/uip.h
Examining data/kvmtool-0.20170904/include/kvm/builtin-list.h
Examining data/kvmtool-0.20170904/include/kvm/kvm-config.h
Examining data/kvmtool-0.20170904/include/kvm/vesa.h
Examining data/kvmtool-0.20170904/include/kvm/fdt.h
Examining data/kvmtool-0.20170904/include/kvm/rwsem.h
Examining data/kvmtool-0.20170904/include/kvm/kvm-cpu.h
Examining data/kvmtool-0.20170904/include/kvm/virtio-rng.h
Examining data/kvmtool-0.20170904/include/kvm/util-init.h
Examining data/kvmtool-0.20170904/include/kvm/gtk3.h
Examining data/kvmtool-0.20170904/include/kvm/iovec.h
Examining data/kvmtool-0.20170904/include/kvm/virtio-console.h
Examining data/kvmtool-0.20170904/include/kvm/read-write.h
Examining data/kvmtool-0.20170904/include/kvm/builtin-stat.h
Examining data/kvmtool-0.20170904/include/kvm/of_pci.h
Examining data/kvmtool-0.20170904/include/kvm/virtio.h
Examining data/kvmtool-0.20170904/include/kvm/brlock.h
Examining data/kvmtool-0.20170904/include/kvm/virtio-scsi.h
Examining data/kvmtool-0.20170904/include/kvm/builtin-resume.h
Examining data/kvmtool-0.20170904/include/kvm/virtio-balloon.h
Examining data/kvmtool-0.20170904/include/kvm/ioeventfd.h
Examining data/kvmtool-0.20170904/include/kvm/symbol.h
Examining data/kvmtool-0.20170904/include/kvm/qcow.h
Examining data/kvmtool-0.20170904/include/kvm/util.h
Examining data/kvmtool-0.20170904/include/kvm/8250-serial.h
Examining data/kvmtool-0.20170904/include/kvm/strbuf.h
Examining data/kvmtool-0.20170904/include/kvm/parse-options.h
Examining data/kvmtool-0.20170904/include/kvm/builtin-debug.h
Examining data/kvmtool-0.20170904/include/kvm/builtin-help.h
Examining data/kvmtool-0.20170904/include/kvm/kvm.h
Examining data/kvmtool-0.20170904/include/kvm/disk-image.h
Examining data/kvmtool-0.20170904/include/kvm/builtin-setup.h
Examining data/kvmtool-0.20170904/include/kvm/virtio-net.h
Examining data/kvmtool-0.20170904/include/kvm/virtio-blk.h
Examining data/kvmtool-0.20170904/include/kvm/virtio-pci.h
Examining data/kvmtool-0.20170904/include/kvm/builtin-version.h
Examining data/kvmtool-0.20170904/include/kvm/msi.h
Examining data/kvmtool-0.20170904/include/kvm/vnc.h
Examining data/kvmtool-0.20170904/include/linux/psci.h
Examining data/kvmtool-0.20170904/include/linux/rbtree.h
Examining data/kvmtool-0.20170904/include/linux/vhost.h
Examining data/kvmtool-0.20170904/include/linux/rbtree_augmented.h
Examining data/kvmtool-0.20170904/include/linux/compiler.h
Examining data/kvmtool-0.20170904/include/linux/9p.h
Examining data/kvmtool-0.20170904/include/linux/byteorder.h
Examining data/kvmtool-0.20170904/include/linux/types.h
Examining data/kvmtool-0.20170904/include/linux/virtio_scsi.h
Examining data/kvmtool-0.20170904/include/linux/virtio_mmio.h
Examining data/kvmtool-0.20170904/include/linux/kernel.h
Examining data/kvmtool-0.20170904/include/linux/list.h
Examining data/kvmtool-0.20170904/include/linux/bitops.h
Examining data/kvmtool-0.20170904/include/linux/stddef.h
Examining data/kvmtool-0.20170904/include/linux/stringify.h
Examining data/kvmtool-0.20170904/include/linux/sizes.h
Examining data/kvmtool-0.20170904/include/linux/virtio_net.h
Examining data/kvmtool-0.20170904/include/linux/kvm.h
Examining data/kvmtool-0.20170904/include/linux/virtio_ids.h
Examining data/kvmtool-0.20170904/include/linux/err.h
Examining data/kvmtool-0.20170904/include/linux/prefetch.h
Examining data/kvmtool-0.20170904/disk/blk.c
Examining data/kvmtool-0.20170904/disk/raw.c
Examining data/kvmtool-0.20170904/disk/core.c
Examining data/kvmtool-0.20170904/disk/qcow.c
Examining data/kvmtool-0.20170904/builtin-setup.c
Examining data/kvmtool-0.20170904/ioport.c
Examining data/kvmtool-0.20170904/framebuffer.c
Examining data/kvmtool-0.20170904/builtin-stat.c
Examining data/kvmtool-0.20170904/mips/kvm-cpu.c
Examining data/kvmtool-0.20170904/mips/kvm.c
Examining data/kvmtool-0.20170904/mips/include/asm/kvm.h
Examining data/kvmtool-0.20170904/mips/include/kvm/kvm-config-arch.h
Examining data/kvmtool-0.20170904/mips/include/kvm/kvm-arch.h
Examining data/kvmtool-0.20170904/mips/include/kvm/barrier.h
Examining data/kvmtool-0.20170904/mips/include/kvm/fdt-arch.h
Examining data/kvmtool-0.20170904/mips/include/kvm/kvm-cpu-arch.h
Examining data/kvmtool-0.20170904/arm/kvm-cpu.c
Examining data/kvmtool-0.20170904/arm/pci.c
Examining data/kvmtool-0.20170904/arm/kvm.c
Examining data/kvmtool-0.20170904/arm/fdt.c
Examining data/kvmtool-0.20170904/arm/pmu.c
Examining data/kvmtool-0.20170904/arm/include/arm-common/pci.h
Examining data/kvmtool-0.20170904/arm/include/arm-common/kvm-config-arch.h
Examining data/kvmtool-0.20170904/arm/include/arm-common/kvm-arch.h
Examining data/kvmtool-0.20170904/arm/include/arm-common/pmu.h
Examining data/kvmtool-0.20170904/arm/include/arm-common/timer.h
Examining data/kvmtool-0.20170904/arm/include/arm-common/gic.h
Examining data/kvmtool-0.20170904/arm/include/arm-common/fdt-arch.h
Examining data/kvmtool-0.20170904/arm/include/arm-common/kvm-cpu-arch.h
Examining data/kvmtool-0.20170904/arm/aarch64/kvm-cpu.c
Examining data/kvmtool-0.20170904/arm/aarch64/include/asm/kvm.h
Examining data/kvmtool-0.20170904/arm/aarch64/include/kvm/kvm-config-arch.h
Examining data/kvmtool-0.20170904/arm/aarch64/include/kvm/kvm-arch.h
Examining data/kvmtool-0.20170904/arm/aarch64/include/kvm/barrier.h
Examining data/kvmtool-0.20170904/arm/aarch64/include/kvm/fdt-arch.h
Examining data/kvmtool-0.20170904/arm/aarch64/include/kvm/kvm-cpu-arch.h
Examining data/kvmtool-0.20170904/arm/aarch64/arm-cpu.c
Examining data/kvmtool-0.20170904/arm/ioport.c
Examining data/kvmtool-0.20170904/arm/gic.c
Examining data/kvmtool-0.20170904/arm/timer.c
Examining data/kvmtool-0.20170904/arm/aarch32/kvm-cpu.c
Examining data/kvmtool-0.20170904/arm/aarch32/include/asm/kvm.h
Examining data/kvmtool-0.20170904/arm/aarch32/include/kvm/kvm-config-arch.h
Examining data/kvmtool-0.20170904/arm/aarch32/include/kvm/kvm-arch.h
Examining data/kvmtool-0.20170904/arm/aarch32/include/kvm/barrier.h
Examining data/kvmtool-0.20170904/arm/aarch32/include/kvm/fdt-arch.h
Examining data/kvmtool-0.20170904/arm/aarch32/include/kvm/kvm-cpu-arch.h
Examining data/kvmtool-0.20170904/arm/aarch32/arm-cpu.c
Examining data/kvmtool-0.20170904/irq.c
Examining data/kvmtool-0.20170904/term.c
Examining data/kvmtool-0.20170904/kvm-ipc.c
Examining data/kvmtool-0.20170904/builtin-sandbox.c
Examining data/kvmtool-0.20170904/mmio.c
Examining data/kvmtool-0.20170904/util/read-write.c
Examining data/kvmtool-0.20170904/util/strbuf.c
Examining data/kvmtool-0.20170904/util/util.c
Examining data/kvmtool-0.20170904/util/init.c
Examining data/kvmtool-0.20170904/util/rbtree.c
Examining data/kvmtool-0.20170904/util/iovec.c
Examining data/kvmtool-0.20170904/util/threadpool.c
Examining data/kvmtool-0.20170904/util/rbtree-interval.c
Examining data/kvmtool-0.20170904/util/parse-options.c
Examining data/kvmtool-0.20170904/builtin-resume.c
Examining data/kvmtool-0.20170904/builtin-debug.c
Examining data/kvmtool-0.20170904/builtin-balloon.c
Examining data/kvmtool-0.20170904/virtio/9p-pdu.c
Examining data/kvmtool-0.20170904/virtio/pci.c
Examining data/kvmtool-0.20170904/virtio/balloon.c
Examining data/kvmtool-0.20170904/virtio/core.c
Examining data/kvmtool-0.20170904/virtio/rng.c
Examining data/kvmtool-0.20170904/virtio/mmio.c
Examining data/kvmtool-0.20170904/virtio/console.c
Examining data/kvmtool-0.20170904/virtio/net.c
Examining data/kvmtool-0.20170904/virtio/scsi.c
Examining data/kvmtool-0.20170904/virtio/blk.c
Examining data/kvmtool-0.20170904/virtio/9p.c
Examining data/kvmtool-0.20170904/symbol.c
Examining data/kvmtool-0.20170904/powerpc/kvm-cpu.c
Examining data/kvmtool-0.20170904/powerpc/kvm.c
Examining data/kvmtool-0.20170904/powerpc/spapr_hvcons.c
Examining data/kvmtool-0.20170904/powerpc/spapr_hvcons.h
Examining data/kvmtool-0.20170904/powerpc/cpu_info.h
Examining data/kvmtool-0.20170904/powerpc/spapr.h
Examining data/kvmtool-0.20170904/powerpc/include/asm/kvm.h
Examining data/kvmtool-0.20170904/powerpc/include/kvm/kvm-config-arch.h
Examining data/kvmtool-0.20170904/powerpc/include/kvm/kvm-arch.h
Examining data/kvmtool-0.20170904/powerpc/include/kvm/barrier.h
Examining data/kvmtool-0.20170904/powerpc/include/kvm/fdt-arch.h
Examining data/kvmtool-0.20170904/powerpc/include/kvm/kvm-cpu-arch.h
Examining data/kvmtool-0.20170904/powerpc/cpu_info.c
Examining data/kvmtool-0.20170904/powerpc/ioport.c
Examining data/kvmtool-0.20170904/powerpc/spapr_pci.c
Examining data/kvmtool-0.20170904/powerpc/spapr_pci.h
Examining data/kvmtool-0.20170904/powerpc/boot.c
Examining data/kvmtool-0.20170904/powerpc/spapr_rtas.c
Examining data/kvmtool-0.20170904/powerpc/xics.h
Examining data/kvmtool-0.20170904/powerpc/xics.c
Examining data/kvmtool-0.20170904/powerpc/spapr_hcall.c
Examining data/kvmtool-0.20170904/builtin-list.c
Examining data/kvmtool-0.20170904/builtin-run.c

FINAL RESULTS:

data/kvmtool-0.20170904/virtio/9p.c:360:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	ret = chmod(full_path, mode & 0777);
data/kvmtool-0.20170904/virtio/9p.c:401:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	ret = chmod(full_path, mode & 0777);
data/kvmtool-0.20170904/virtio/9p.c:738:9:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
		ret = chmod(fid->abs_path, p9attr.mode);
data/kvmtool-0.20170904/virtio/9p.c:907:8:  [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.
	ret = readlink(fid->abs_path, target_path, PATH_MAX - 1);
data/kvmtool-0.20170904/virtio/9p.c:977:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	ret = chmod(full_path, mode & 0777);
data/kvmtool-0.20170904/guest/init.c:63:7:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
		if (access("/virt/sandbox.sh", R_OK) == 0)
data/kvmtool-0.20170904/hw/pci-shmem.c:339:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
		strcpy(handle, default_handle);
data/kvmtool-0.20170904/include/kvm/util.h:40:71:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));
data/kvmtool-0.20170904/include/kvm/util.h:42:64:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
extern int pr_err(const char *err, ...) __attribute__((format (printf, 1, 2)));
data/kvmtool-0.20170904/include/kvm/util.h:43:69:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
extern void pr_warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
data/kvmtool-0.20170904/include/kvm/util.h:44:66:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
extern void pr_info(const char *err, ...) __attribute__((format (printf, 1, 2)));
data/kvmtool-0.20170904/kvm-ipc.c:46:6:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	if (access(full_name, F_OK) == 0) {
data/kvmtool-0.20170904/kvm-ipc.c:125:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(path, "%s/%s", base_path, dent->d_name);
data/kvmtool-0.20170904/kvm.c:70:2:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	vsnprintf(tmp, sizeof(tmp), fmt, args);
data/kvmtool-0.20170904/mips/kvm.c:138:2:  [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(p + cmdline_offset, kvm->cfg.real_cmdline); /* maximum size is 2K */
data/kvmtool-0.20170904/net/uip/dhcp.c:51:7:  [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(fp, "%s %s\n", key, val) != 2)
data/kvmtool-0.20170904/net/uip/dhcp.c:134:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy((void *) addr, EMPTY_ADDR);
data/kvmtool-0.20170904/powerpc/kvm.c:370:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(cpu_name, "PowerPC,%s@%d", cpu_info->name, i);
data/kvmtool-0.20170904/powerpc/kvm.c:372:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(cpu_name, "PowerPC,%s", cpu_info->name);
data/kvmtool-0.20170904/powerpc/spapr.h:74:10:  [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 { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
data/kvmtool-0.20170904/powerpc/spapr_pci.c:31:7:  [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 { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
data/kvmtool-0.20170904/powerpc/spapr_pci.c:269:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(nodename, "pci@%" PRIx64, phb.buid);
data/kvmtool-0.20170904/powerpc/xics.c:28:7:  [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 { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
data/kvmtool-0.20170904/util/util.c:16:2:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	vsnprintf(msg, sizeof(msg), err, params);
data/kvmtool-0.20170904/virtio/9p.c:57:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(pfid->abs_path, dev->root_dir);
data/kvmtool-0.20170904/virtio/net.c:305:3:  [4] (shell) execl:
  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.
		execl(script, script, tap_name, NULL);
data/kvmtool-0.20170904/builtin-run.c:357:8:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
	tmp = realpath(kvm->cfg.sandbox, NULL);
data/kvmtool-0.20170904/builtin-run.c:409:8:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
		if (!realpath(src, resolved_path))
data/kvmtool-0.20170904/include/kvm/kvm.h:21:19:  [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.
#define HOME_DIR		getenv("HOME")
data/kvmtool-0.20170904/kvm.c:74:7:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
	if (!realpath(tmp, kvm_dir))
data/kvmtool-0.20170904/virtio/9p.c:1473:6:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
	if (realpath(arg, tmp)) {
data/kvmtool-0.20170904/virtio/9p.c:1494:7:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
		if (realpath(arg, tmp) == 0 ||
data/kvmtool-0.20170904/virtio/9p.c:1510:7:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
		if (realpath(path, tmp) == 0 ||
data/kvmtool-0.20170904/arm/fdt.c:31: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(dtb_file, O_CREAT | O_TRUNC | O_RDWR, 0666);
data/kvmtool-0.20170904/arm/fdt.c:53: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 cpu_name[CPU_NAME_MAX_LEN];
data/kvmtool-0.20170904/builtin-debug.c:54: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 buff[BUFFER_SIZE];
data/kvmtool-0.20170904/builtin-run.c:74: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[PATH_MAX];
data/kvmtool-0.20170904/builtin-run.c:167: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 name[16];
data/kvmtool-0.20170904/builtin-run.c:171: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(name, "kvm-vcpu-%lu", current_kvm_cpu->cpu_id);
data/kvmtool-0.20170904/builtin-run.c:195:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char kernel[PATH_MAX];
data/kvmtool-0.20170904/builtin-run.c:348: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[PATH_MAX], script[PATH_MAX], *tmp;
data/kvmtool-0.20170904/builtin-run.c:407: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 resolved_path[PATH_MAX];
data/kvmtool-0.20170904/builtin-run.c:422: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 program[PATH_MAX];
data/kvmtool-0.20170904/builtin-run.c:427: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(kvm->cfg.sandbox, O_RDWR | O_CREAT, 0777);
data/kvmtool-0.20170904/builtin-run.c:456:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char real_cmdline[2048], default_name[20];
data/kvmtool-0.20170904/builtin-run.c:575:4:  [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(default_name, "guest-%u", getpid());
data/kvmtool-0.20170904/builtin-run.c:581: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 tmp[PATH_MAX];
data/kvmtool-0.20170904/builtin-run.c:595:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(real_cmdline, " rw rootflags=trans=virtio,version=9p2000.L,cache=loose rootfstype=9p");
data/kvmtool-0.20170904/builtin-run.c:600:4:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
			strcat(real_cmdline, " init=/virt/pre_init");
data/kvmtool-0.20170904/builtin-run.c:602:4:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
			strcat(real_cmdline, " init=/virt/init");
data/kvmtool-0.20170904/builtin-run.c:606:5:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
				strcat(real_cmdline, "  ip=dhcp");
data/kvmtool-0.20170904/builtin-setup.c:59: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).
	in_fd = open(from, O_RDONLY);
data/kvmtool-0.20170904/builtin-setup.c:66: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).
	out_fd = open(to, O_RDWR | O_CREAT | O_TRUNC, st.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO));
data/kvmtool-0.20170904/builtin-setup.c:81: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(dst, src, st.st_size);
data/kvmtool-0.20170904/builtin-setup.c:128: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[PATH_MAX];
data/kvmtool-0.20170904/builtin-setup.c:134: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_EXCL | O_CREAT | O_WRONLY, 0755);
data/kvmtool-0.20170904/builtin-setup.c:178: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[PATH_MAX];
data/kvmtool-0.20170904/builtin-setup.c:184: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, "w");
data/kvmtool-0.20170904/builtin-setup.c:199: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 target[PATH_MAX];
data/kvmtool-0.20170904/builtin-setup.c:200: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 name[PATH_MAX];
data/kvmtool-0.20170904/builtin-setup.c:211: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 name[PATH_MAX];
data/kvmtool-0.20170904/builtin-setup.c:220: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 name[PATH_MAX];
data/kvmtool-0.20170904/builtin-setup.c:229: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[PATH_MAX];
data/kvmtool-0.20170904/disk/blk.c:55: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(filename, flags);
data/kvmtool-0.20170904/disk/core.c:145: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(filename, flags);
data/kvmtool-0.20170904/disk/qcow.c:345: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(dst, q->cluster_cache + clust_offset, length);
data/kvmtool-0.20170904/disk/qcow.c:440: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(dst, q->cluster_cache + clust_offset, length);
data/kvmtool-0.20170904/disk/qcow.c:1028: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(q->copy_buff + clust_off, buf, len);
data/kvmtool-0.20170904/disk/raw.c:46: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(iov->iov_base, disk->priv + offset, iov->iov_len);
data/kvmtool-0.20170904/disk/raw.c:64: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(disk->priv + offset, iov->iov_base, iov->iov_len);
data/kvmtool-0.20170904/hw/i8042.c:67: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			kq[QUEUE_SIZE];	/* Keyboard queue */
data/kvmtool-0.20170904/hw/i8042.c:71: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			mq[QUEUE_SIZE];
data/kvmtool-0.20170904/hw/pci-shmem.c:118: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(mem + addr - msix_block, data, len);
data/kvmtool-0.20170904/hw/pci-shmem.c:120: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(data, mem + addr - msix_block, len);
data/kvmtool-0.20170904/hw/serial.c:35: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			txbuf[FIFO_LEN];
data/kvmtool-0.20170904/hw/serial.c:36: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			rxbuf[FIFO_LEN];
data/kvmtool-0.20170904/hw/serial.c:376: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 dev_name[DEVICE_NAME_MAX_LEN];
data/kvmtool-0.20170904/include/common-cmds.h:3: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[16];
data/kvmtool-0.20170904/include/common-cmds.h:4: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 help[80];
data/kvmtool-0.20170904/include/kvm/virtio-9p.h:29: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			abs_path[PATH_MAX];
data/kvmtool-0.20170904/include/kvm/virtio-9p.h:53: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			root_dir[PATH_MAX];
data/kvmtool-0.20170904/include/kvm/virtio-mmio.h:19: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	magic[4];
data/kvmtool-0.20170904/include/kvm/virtio-net.h:15: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 guest_mac[6];
data/kvmtool-0.20170904/include/kvm/virtio-net.h:16: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 host_mac[6];
data/kvmtool-0.20170904/include/linux/kvm.h:132: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 dummy[512];  /* reserving space */
data/kvmtool-0.20170904/include/linux/kvm.h:366: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 padding[256];
data/kvmtool-0.20170904/include/linux/kvm.h:380: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 padding[2048];
data/kvmtool-0.20170904/include/linux/kvm.h:597: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 reserved[64];
data/kvmtool-0.20170904/include/linux/vhost.h:145: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 vhost_wwpn[224]; /* TRANSPORT_IQN_LEN */
data/kvmtool-0.20170904/kvm-ipc.c:36: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 full_name[PATH_MAX];
data/kvmtool-0.20170904/kvm-ipc.c:81: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 full_name[PATH_MAX];
data/kvmtool-0.20170904/kvm-ipc.c:91: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 sock_file[PATH_MAX];
data/kvmtool-0.20170904/kvm-ipc.c:122: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 path[PATH_MAX];
data/kvmtool-0.20170904/kvm.c:64:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char kvm_dir[PATH_MAX];
data/kvmtool-0.20170904/kvm.c:68: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 tmp[PATH_MAX];
data/kvmtool-0.20170904/kvm.c:284: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).
	kvm->sys_fd = open(kvm->cfg.dev, O_RDWR);
data/kvmtool-0.20170904/kvm.c:360:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	unsigned char id[4];
data/kvmtool-0.20170904/kvm.c:378:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd_kernel = open(kernel_filename, O_RDONLY);
data/kvmtool-0.20170904/kvm.c:383: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).
		fd_initrd = open(initrd_filename, O_RDONLY);
data/kvmtool-0.20170904/mips/kvm.c:130:3:  [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(p + cmdline_offset, "mem=0x%llx@0 ",
data/kvmtool-0.20170904/mips/kvm.c:133:3:  [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(p + cmdline_offset, "mem=0x%llx@0 mem=0x%llx@0x%llx ",
data/kvmtool-0.20170904/net/uip/buf.c:104: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->vnet, arg->vnet, arg->vnet_len);
data/kvmtool-0.20170904/net/uip/buf.c:105: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->eth, arg->eth, arg->eth_len);
data/kvmtool-0.20170904/net/uip/core.c:43: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(buf, iov[i].iov_base, iov[i].iov_len);
data/kvmtool-0.20170904/net/uip/csum.c:55:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy((u8 *)&udp->sport + udp_len + 1, &hdr, sizeof(hdr));
data/kvmtool-0.20170904/net/uip/csum.c:58:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy((u8 *)&udp->sport + udp_len, &hdr, sizeof(hdr));
data/kvmtool-0.20170904/net/uip/csum.c:86: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((u8 *)&tcp->sport + tcp_len + 1, &hdr, sizeof(hdr));
data/kvmtool-0.20170904/net/uip/csum.c:89: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((u8 *)&tcp->sport + tcp_len, &hdr, sizeof(hdr));
data/kvmtool-0.20170904/net/uip/dhcp.c:39: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 key[256], val[256];
data/kvmtool-0.20170904/net/uip/dhcp.c:46: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).
	fp = fopen("/etc/resolv.conf", "r");
data/kvmtool-0.20170904/net/uip/dhcp.c:79: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(&opt[i], info->domain_name, domain_name_len);
data/kvmtool-0.20170904/net/uip/tcp.c:147: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(uip_tcp_payload(tcp2), sk->payload, payload_len);
data/kvmtool-0.20170904/net/uip/udp.c:136: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(udp2->payload, payload, payload_len);
data/kvmtool-0.20170904/pci.c:61:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(p, data, size);
data/kvmtool-0.20170904/pci.c:70:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(data, p, size);
data/kvmtool-0.20170904/pci.c:162: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(p + offset, &sz, sizeof(sz));
data/kvmtool-0.20170904/pci.c:164: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(p + offset, data, size);
data/kvmtool-0.20170904/pci.c:183:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
			memcpy(data, p + offset, size);
data/kvmtool-0.20170904/powerpc/cpu_info.c:108: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(&cpu_info->mmu_info.sps, fallback_sps, sizeof(fallback_sps));
data/kvmtool-0.20170904/powerpc/include/asm/kvm.h:352: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 name[120];
data/kvmtool-0.20170904/powerpc/kvm.c:43:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char kern_cmdline[2048];
data/kvmtool-0.20170904/powerpc/kvm.c:288: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 		cpu_name[30];
data/kvmtool-0.20170904/powerpc/spapr_pci.c:236: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 nodename[256];
data/kvmtool-0.20170904/powerpc/spapr_pci.c:302:3:  [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(nodename, "pci@%u,%u", devid, fn);
data/kvmtool-0.20170904/term.c:78: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 *)iov[TERM_FD_IN].iov_base)	= (char)c;
data/kvmtool-0.20170904/term.c:145: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 new_pty[PATH_MAX];
data/kvmtool-0.20170904/term.c:164:12:  [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 tty = atoi(arg);
data/kvmtool-0.20170904/ui/vnc.c:26:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char letters[26] = {
data/kvmtool-0.20170904/ui/vnc.c:36:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char num[10] = {
data/kvmtool-0.20170904/ui/vnc.c:185: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 argv[1][1] = {{0}};
data/kvmtool-0.20170904/util/iovec.c:37: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(iov->iov_base, kdata, copy);
data/kvmtool-0.20170904/util/iovec.c:64: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(iov->iov_base + offset, kdata, copy);
data/kvmtool-0.20170904/util/iovec.c:84: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(kdata, iov->iov_base, copy);
data/kvmtool-0.20170904/util/iovec.c:114: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(kdata, base, copy);
data/kvmtool-0.20170904/util/strbuf.c:36: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(dest, src, len);
data/kvmtool-0.20170904/util/strbuf.c:59:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(dest, src, len);
data/kvmtool-0.20170904/util/util.c:15: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 msg[1024];
data/kvmtool-0.20170904/util/util.c:86:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char mpath[PATH_MAX];
data/kvmtool-0.20170904/util/util.c:107:7:  [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).
	fd = mkstemp(mpath);
data/kvmtool-0.20170904/virtio/9p-pdu.c:24:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
			memcpy(data, iov[i].iov_base + offset, len);
data/kvmtool-0.20170904/virtio/9p-pdu.c:49: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(iov[i].iov_base + offset, data, len);
data/kvmtool-0.20170904/virtio/9p.c:266: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 full_path[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:299: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).
		new_fid->fd  = open(new_fid->abs_path,
data/kvmtool-0.20170904/virtio/9p.c:324: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 full_path[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:352: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(full_path, flags | O_CREAT, mode);
data/kvmtool-0.20170904/virtio/9p.c:384: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 full_path[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:457:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
			char tmp[PATH_MAX] = {0};
data/kvmtool-0.20170904/virtio/9p.c:874: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 full_path[PATH_MAX], *new_name;
data/kvmtool-0.20170904/virtio/9p.c:901: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 target_path[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:959: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 full_path[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:1030: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 new_name[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:1068: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 full_path[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:1150: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 *p, tmp_name[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:1188: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 old_full_path[PATH_MAX], new_full_path[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:1230: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 full_path[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:1460: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 tmp[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:1483: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[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:1489: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 tmp[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:1505: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 tmp[PATH_MAX];
data/kvmtool-0.20170904/virtio/9p.c:1565: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(&p9dev->config->tag, tag_name, strlen(tag_name));
data/kvmtool-0.20170904/virtio/balloon.c:99: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(bdev->stats, stat, iov[0].iov_len);
data/kvmtool-0.20170904/virtio/mmio.c:240: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 dev_name[DEVICE_NAME_MAX_LEN];
data/kvmtool-0.20170904/virtio/net.c:55: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				tap_name[IFNAMSIZ];
data/kvmtool-0.20170904/virtio/net.c:120:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
			unsigned char buffer[MAX_PACKET_SIZE + sizeof(struct virtio_net_hdr_mrg_rxbuf)];
data/kvmtool-0.20170904/virtio/net.c:339: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(&(ifr.ifr_addr), &sin, sizeof(ifr.ifr_addr));
data/kvmtool-0.20170904/virtio/net.c:386: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).
		ndev->tap_fd = open(tap_file, O_RDWR);
data/kvmtool-0.20170904/virtio/net.c:700: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).
	ndev->vhost_fd = open("/dev/vhost-net", O_RDWR);
data/kvmtool-0.20170904/virtio/net.c:770:14:  [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).
		p->vhost = atoi(val);
data/kvmtool-0.20170904/virtio/net.c:772: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).
		p->fd = atoi(val);
data/kvmtool-0.20170904/virtio/net.c:774: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).
		p->mq = atoi(val);
data/kvmtool-0.20170904/virtio/pci.c:328: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(data, (void *)&table[vecnum] + offset, len);
data/kvmtool-0.20170904/virtio/pci.c:332:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy((void *)&table[vecnum] + offset, data, len);
data/kvmtool-0.20170904/virtio/rng.c:167:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	rdev->fd = open("/dev/random", O_RDONLY | O_NONBLOCK);
data/kvmtool-0.20170904/virtio/scsi.c:190: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).
	sdev->vhost_fd = open("/dev/vhost-scsi", O_RDWR);
data/kvmtool-0.20170904/x86/bios.c:41:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(p, handler->handler, handler->size);
data/kvmtool-0.20170904/x86/bios.c:148:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(p, bios_rom, bios_rom_size);
data/kvmtool-0.20170904/x86/boot.c:21: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(firmware_filename, O_RDONLY);
data/kvmtool-0.20170904/x86/cpuid.c:25: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(signature, "LKVMLKVMLKVM", 12);
data/kvmtool-0.20170904/x86/include/asm/kvm.h:124: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 regs[KVM_APIC_REG_SIZE];
data/kvmtool-0.20170904/x86/include/asm/mpspec_def.h:22: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 signature[4];		/* "_MP_"			*/
data/kvmtool-0.20170904/x86/include/asm/mpspec_def.h:37: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 signature[4];
data/kvmtool-0.20170904/x86/include/asm/mpspec_def.h:41: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 oem[8];
data/kvmtool-0.20170904/x86/include/asm/mpspec_def.h:42: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 productid[12];
data/kvmtool-0.20170904/x86/include/asm/mpspec_def.h:80:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	unsigned char bustype[6];
data/kvmtool-0.20170904/x86/include/asm/mpspec_def.h:149: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 signature[4];
data/kvmtool-0.20170904/x86/include/asm/mpspec_def.h:153: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  mpc[8];
data/kvmtool-0.20170904/x86/include/kvm/bios-export.h:6: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 bios_rom[0];
data/kvmtool-0.20170904/x86/include/kvm/bios-export.h:7: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 bios_rom_end[0];
data/kvmtool-0.20170904/x86/interrupt.c:12: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(dst, itable->entries, sizeof(itable->entries));
data/kvmtool-0.20170904/x86/kvm-cpu.c:342: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 sym[MAX_SYM_LEN] = SYMBOL_DEFAULT_UNKNOWN, *psym;
data/kvmtool-0.20170904/x86/kvm.c:124:2:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
	strcpy(cmdline, "noapic noacpi pci=conf1 reboot=k panic=1 i8042.direct=1 "
data/kvmtool-0.20170904/x86/kvm.c:127:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(cmdline, " video=vesafb console=tty0");
data/kvmtool-0.20170904/x86/kvm.c:129:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(cmdline, " console=ttyS0 earlyprintk=serial i8042.noaux=1");
data/kvmtool-0.20170904/x86/kvm.c:279: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(p, kernel_cmdline, cmdline_size - 1);
data/kvmtool-0.20170904/x86/mptable.c:268: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(guest_flat_to_host(kvm, real_mpc_table), mpc_table, size);
data/kvmtool-0.20170904/builtin-help.c:25:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if (longest < strlen(common_cmds[i].name))
data/kvmtool-0.20170904/builtin-help.c:26: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).
			longest = strlen(common_cmds[i].name);
data/kvmtool-0.20170904/builtin-list.c:47:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	r = read(sock, &pid, sizeof(pid));
data/kvmtool-0.20170904/builtin-list.c:63:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	r = read(sock, &vmstate, sizeof(vmstate));
data/kvmtool-0.20170904/builtin-run.c:615:3:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
		strcat(real_cmdline, " ");
data/kvmtool-0.20170904/builtin-stat.c:67:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	r = read(sock, &stats, sizeof(stats));
data/kvmtool-0.20170904/disk/core.c:68:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while (read(disk->evt, &dummy, sizeof(dummy)) > 0) {
data/kvmtool-0.20170904/disk/core.c:274:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (disk->ops->read) {
data/kvmtool-0.20170904/disk/core.c:275:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		total = disk->ops->read(disk, sector, iov, iovcount, param);
data/kvmtool-0.20170904/hw/pci-shmem.c:247: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).
	const int skip_pci = strlen("pci:");
data/kvmtool-0.20170904/hw/pci-shmem.c:313:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	const int skip_handle = strlen("handle=");
data/kvmtool-0.20170904/hw/pci-shmem.c:322:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(handle, p, next - p);
data/kvmtool-0.20170904/hw/pci-shmem.c:333: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).
		p += strlen("create");
data/kvmtool-0.20170904/hw/pci-shmem.c:338: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).
		handle = malloc(strlen(default_handle) + 1);
data/kvmtool-0.20170904/include/kvm/disk-image.h:35:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ssize_t (*read)(struct disk_image *disk, u64 sector, const struct iovec *iov,
data/kvmtool-0.20170904/include/kvm/strbuf.h:18: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).
	size_t len = strlen(prefix);
data/kvmtool-0.20170904/include/kvm/symbol.h:22:12:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	char *s = strncpy(sym, SYMBOL_DEFAULT_UNKNOWN, size);
data/kvmtool-0.20170904/include/kvm/util.h:90:2:  [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(MSECS_TO_USECS(msecs));
data/kvmtool-0.20170904/ioeventfd.c:41:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (read(ioevent->fd, &tmp, sizeof(tmp)) < 0)
data/kvmtool-0.20170904/ioeventfd.c:112:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	r = read(epoll_stop_fd, &tmp, sizeof(tmp));
data/kvmtool-0.20170904/kvm-cpu.c:123:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (read(task_eventfd, &count, sizeof(count)) < 0)
data/kvmtool-0.20170904/kvm-ipc.c:59:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len = strlen(local.sun_path) + sizeof(local.sun_family);
data/kvmtool-0.20170904/kvm-ipc.c:100:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len = strlen(local.sun_path) + sizeof(local.sun_family);
data/kvmtool-0.20170904/kvm-ipc.c:155: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).
			ssize_t name_len = strlen(entry->d_name);
data/kvmtool-0.20170904/kvm-ipc.c:268:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	n = read(fd, &head, sizeof(head));
data/kvmtool-0.20170904/kvm.c:77:2:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
	strcat(kvm_dir, "/");
data/kvmtool-0.20170904/kvm.c:462:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (read(pause_event, &cur_read, sizeof(cur_read)) < 0)
data/kvmtool-0.20170904/mips/kvm.c:299:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	nr = read(fd_kernel, &eh, sizeof(eh));
data/kvmtool-0.20170904/net/uip/dhcp.c:76:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		domain_name_len	= strlen(info->domain_name);
data/kvmtool-0.20170904/net/uip/dhcp.c:132:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	opt[i++]	= strlen(EMPTY_ADDR);
data/kvmtool-0.20170904/net/uip/dhcp.c:135: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).
	i		+= strlen(EMPTY_ADDR);
data/kvmtool-0.20170904/net/uip/tcp.c:191:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(sk->fd, payload, UIP_MAX_TCP_PAYLOAD);
data/kvmtool-0.20170904/powerpc/kvm.c:198:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(kern_cmdline, kernel_cmdline, 2048);
data/kvmtool-0.20170904/util/parse-options.c:323:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(arg) < 3)
data/kvmtool-0.20170904/util/parse-options.c:367: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).
		arg_end = arg + strlen(arg);
data/kvmtool-0.20170904/util/read-write.c:15:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	nr = read(fd, buf, count);
data/kvmtool-0.20170904/util/strbuf.c:25: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).
	size_t dsize = strlen(dest);
data/kvmtool-0.20170904/util/strbuf.c:26: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).
	size_t len = strlen(src);
data/kvmtool-0.20170904/util/strbuf.c:55: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).
	size_t ret = strlen(src);
data/kvmtool-0.20170904/virtio/9p-pdu.c:206: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).
				len = MIN(strlen(s), USHRT_MAX);
data/kvmtool-0.20170904/virtio/9p.c:50:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len = strlen(dev->root_dir);
data/kvmtool-0.20170904/virtio/9p.c:58: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).
	pfid->path = pfid->abs_path + strlen(pfid->abs_path);
data/kvmtool-0.20170904/virtio/9p.c:232:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len = strlen(path);
data/kvmtool-0.20170904/virtio/9p.c:422:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	len = strlen(name);
data/kvmtool-0.20170904/virtio/9p.c:426:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(fid->path, name, size);
data/kvmtool-0.20170904/virtio/9p.c:615: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).
	return 24 + strlen(dent->d_name);
data/kvmtool-0.20170904/virtio/9p.c:647:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		u32 read;
data/kvmtool-0.20170904/virtio/9p.c:662:33:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		rcount += pdu->write_offset - read;
data/kvmtool-0.20170904/virtio/9p.c:1134:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	int size = strlen(ancestor);
data/kvmtool-0.20170904/virtio/9p.c:1151: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).
	size_t rp_sz = strlen(old_name);
data/kvmtool-0.20170904/virtio/9p.c:1153: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).
	if (rp_sz == strlen(fid->path)) {
data/kvmtool-0.20170904/virtio/9p.c:1550:53:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	p9dev->config = calloc(1, sizeof(*p9dev->config) + strlen(tag_name) + 1);
data/kvmtool-0.20170904/virtio/9p.c:1556:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(p9dev->root_dir, root, sizeof(p9dev->root_dir));
data/kvmtool-0.20170904/virtio/9p.c:1559: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).
	p9dev->config->tag_len = strlen(tag_name);
data/kvmtool-0.20170904/virtio/9p.c:1565:40:  [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(&p9dev->config->tag, tag_name, strlen(tag_name));
data/kvmtool-0.20170904/virtio/balloon.c:135:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(bdev.stat_waitfd, &tmp, sizeof(tmp)) <= 0)
data/kvmtool-0.20170904/virtio/blk.c:205:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		r = read(bdev->io_efd, &data, sizeof(u64));
data/kvmtool-0.20170904/virtio/net.c:337:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(ifr.ifr_name, ndev->tap_name, sizeof(ndev->tap_name));
data/kvmtool-0.20170904/virtio/net.c:349:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(ifr.ifr_name, ndev->tap_name, sizeof(ndev->tap_name));
data/kvmtool-0.20170904/x86/bios.c:112:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
	strncpy(p, "KVM VESA", VGA_ROM_OEM_STRING_SIZE);
data/kvmtool-0.20170904/x86/boot.c:33:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((nr = read(fd, p, st.st_size)) > 0)
data/kvmtool-0.20170904/x86/kvm.c:249:46:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (memcmp(&boot.hdr.header, BZIMAGE_MAGIC, strlen(BZIMAGE_MAGIC)))
data/kvmtool-0.20170904/x86/kvm.c:274: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).
		cmdline_size = strlen(kernel_cmdline) + 1;

ANALYSIS SUMMARY:

Hits = 258
Lines analyzed = 35286 in approximately 1.04 seconds (33959 lines/second)
Physical Source Lines of Code (SLOC) = 25587
Hits@level = [0] 100 [1]  63 [2] 162 [3]   7 [4]  21 [5]   5
Hits@level+ = [0+] 358 [1+] 258 [2+] 195 [3+]  33 [4+]  26 [5+]   5
Hits/KSLOC@level+ = [0+] 13.9915 [1+] 10.0832 [2+] 7.62106 [3+] 1.28972 [4+] 1.01614 [5+] 0.195412
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.