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/nbdkit-1.22.3/include/nbdkit-common.h Examining data/nbdkit-1.22.3/include/nbdkit-filter.h Examining data/nbdkit-1.22.3/include/nbdkit-version.h Examining data/nbdkit-1.22.3/include/nbdkit-plugin.h Examining data/nbdkit-1.22.3/plugins/vddk/reexec.c Examining data/nbdkit-1.22.3/plugins/vddk/vddk.c Examining data/nbdkit-1.22.3/plugins/vddk/vddk.h Examining data/nbdkit-1.22.3/plugins/vddk/vddk-structs.h Examining data/nbdkit-1.22.3/plugins/vddk/vddk-stubs.h Examining data/nbdkit-1.22.3/plugins/split/split.c Examining data/nbdkit-1.22.3/plugins/linuxdisk/partition-gpt.c Examining data/nbdkit-1.22.3/plugins/linuxdisk/virtual-disk.c Examining data/nbdkit-1.22.3/plugins/linuxdisk/linuxdisk.c Examining data/nbdkit-1.22.3/plugins/linuxdisk/virtual-disk.h Examining data/nbdkit-1.22.3/plugins/linuxdisk/filesystem.c Examining data/nbdkit-1.22.3/plugins/zero/zero.c Examining data/nbdkit-1.22.3/plugins/tar/tar.c Examining data/nbdkit-1.22.3/plugins/null/null.c Examining data/nbdkit-1.22.3/plugins/partitioning/partition-gpt.c Examining data/nbdkit-1.22.3/plugins/partitioning/virtual-disk.c Examining data/nbdkit-1.22.3/plugins/partitioning/partition-mbr.c Examining data/nbdkit-1.22.3/plugins/partitioning/partitioning.c Examining data/nbdkit-1.22.3/plugins/partitioning/virtual-disk.h Examining data/nbdkit-1.22.3/plugins/example2/example2.c Examining data/nbdkit-1.22.3/plugins/libvirt/libvirt-plugin.c Examining data/nbdkit-1.22.3/plugins/gzip/gzip.c Examining data/nbdkit-1.22.3/plugins/cc/cc.c Examining data/nbdkit-1.22.3/plugins/streaming/streaming.c Examining data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c Examining data/nbdkit-1.22.3/plugins/floppy/virtual-floppy.h Examining data/nbdkit-1.22.3/plugins/floppy/floppy.c Examining data/nbdkit-1.22.3/plugins/floppy/virtual-floppy.c Examining data/nbdkit-1.22.3/plugins/data/format.c Examining data/nbdkit-1.22.3/plugins/data/format.h Examining data/nbdkit-1.22.3/plugins/data/data.c Examining data/nbdkit-1.22.3/plugins/info/info.c Examining data/nbdkit-1.22.3/plugins/pattern/pattern.c Examining data/nbdkit-1.22.3/plugins/iso/iso.c Examining data/nbdkit-1.22.3/plugins/python/python.c Examining data/nbdkit-1.22.3/plugins/curl/scripts.c Examining data/nbdkit-1.22.3/plugins/curl/curldefs.h Examining data/nbdkit-1.22.3/plugins/curl/curl.c Examining data/nbdkit-1.22.3/plugins/memory/memory.c Examining data/nbdkit-1.22.3/plugins/golang/src/libguestfs.org/nbdkit/wrappers.h Examining data/nbdkit-1.22.3/plugins/cdi/cdi.c Examining data/nbdkit-1.22.3/plugins/tmpdisk/default-command.c Examining data/nbdkit-1.22.3/plugins/tmpdisk/tmpdisk.c Examining data/nbdkit-1.22.3/plugins/full/full.c Examining data/nbdkit-1.22.3/plugins/tcl/tcl.c Examining data/nbdkit-1.22.3/plugins/perl/perl.c Examining data/nbdkit-1.22.3/plugins/random/random.c Examining data/nbdkit-1.22.3/plugins/example3/example3.c Examining data/nbdkit-1.22.3/plugins/guestfs/guestfs-plugin.c Examining data/nbdkit-1.22.3/plugins/ocaml/ocaml.c Examining data/nbdkit-1.22.3/plugins/torrent/torrent.cpp Examining data/nbdkit-1.22.3/plugins/ssh/ssh.c Examining data/nbdkit-1.22.3/plugins/sh/methods.c Examining data/nbdkit-1.22.3/plugins/sh/sh.c Examining data/nbdkit-1.22.3/plugins/sh/methods.h Examining data/nbdkit-1.22.3/plugins/sh/call.c Examining data/nbdkit-1.22.3/plugins/sh/call.h Examining data/nbdkit-1.22.3/plugins/lua/lua.c Examining data/nbdkit-1.22.3/plugins/nbd/nbd.c Examining data/nbdkit-1.22.3/plugins/ondemand/ondemand.c Examining data/nbdkit-1.22.3/plugins/ondemand/default-command.c Examining data/nbdkit-1.22.3/plugins/eval/methods.c Examining data/nbdkit-1.22.3/plugins/eval/call.c Examining data/nbdkit-1.22.3/plugins/eval/eval.c Examining data/nbdkit-1.22.3/plugins/ruby/ruby.c Examining data/nbdkit-1.22.3/plugins/file/file.c Examining data/nbdkit-1.22.3/plugins/example1/example1.c Examining data/nbdkit-1.22.3/wrapper.c Examining data/nbdkit-1.22.3/server/log.c Examining data/nbdkit-1.22.3/server/socket-activation.c Examining data/nbdkit-1.22.3/server/vfprintf.c Examining data/nbdkit-1.22.3/server/quit.c Examining data/nbdkit-1.22.3/server/protocol.c Examining data/nbdkit-1.22.3/server/public.c Examining data/nbdkit-1.22.3/server/synopsis.c Examining data/nbdkit-1.22.3/server/background.c Examining data/nbdkit-1.22.3/server/main.c Examining data/nbdkit-1.22.3/server/captive.c Examining data/nbdkit-1.22.3/server/plugins.c Examining data/nbdkit-1.22.3/server/signals.c Examining data/nbdkit-1.22.3/server/test-public.c Examining data/nbdkit-1.22.3/server/usergroup.c Examining data/nbdkit-1.22.3/server/filters.c Examining data/nbdkit-1.22.3/server/backend.c Examining data/nbdkit-1.22.3/server/protocol-handshake-oldstyle.c Examining data/nbdkit-1.22.3/server/internal.h Examining data/nbdkit-1.22.3/server/debug-flags.c Examining data/nbdkit-1.22.3/server/exports.c Examining data/nbdkit-1.22.3/server/debug.c Examining data/nbdkit-1.22.3/server/log-stderr.c Examining data/nbdkit-1.22.3/server/crypto.c Examining data/nbdkit-1.22.3/server/threadlocal.c Examining data/nbdkit-1.22.3/server/sockets.c Examining data/nbdkit-1.22.3/server/log-syslog.c Examining data/nbdkit-1.22.3/server/options.h Examining data/nbdkit-1.22.3/server/extents.c Examining data/nbdkit-1.22.3/server/protocol-handshake-newstyle.c Examining data/nbdkit-1.22.3/server/fuzzer.c Examining data/nbdkit-1.22.3/server/locks.c Examining data/nbdkit-1.22.3/server/protocol-handshake.c Examining data/nbdkit-1.22.3/server/connections.c Examining data/nbdkit-1.22.3/filters/noextents/noextents.c Examining data/nbdkit-1.22.3/filters/tar/tar.c Examining data/nbdkit-1.22.3/filters/gzip/gzip.c Examining data/nbdkit-1.22.3/filters/retry/retry.c Examining data/nbdkit-1.22.3/filters/nozero/nozero.c Examining data/nbdkit-1.22.3/filters/partition/partition-gpt.c Examining data/nbdkit-1.22.3/filters/partition/partition-mbr.c Examining data/nbdkit-1.22.3/filters/partition/partition.c Examining data/nbdkit-1.22.3/filters/partition/partition.h Examining data/nbdkit-1.22.3/filters/readahead/readahead.c Examining data/nbdkit-1.22.3/filters/ip/ip.c Examining data/nbdkit-1.22.3/filters/exitlast/exitlast.c Examining data/nbdkit-1.22.3/filters/stats/stats.c Examining data/nbdkit-1.22.3/filters/extentlist/extentlist.c Examining data/nbdkit-1.22.3/filters/ext2/io.c Examining data/nbdkit-1.22.3/filters/ext2/io.h Examining data/nbdkit-1.22.3/filters/ext2/ext2.c Examining data/nbdkit-1.22.3/filters/fua/fua.c Examining data/nbdkit-1.22.3/filters/log/log.c Examining data/nbdkit-1.22.3/filters/xz/xz.c Examining data/nbdkit-1.22.3/filters/xz/blkcache.c Examining data/nbdkit-1.22.3/filters/xz/xzfile.h Examining data/nbdkit-1.22.3/filters/xz/xzfile.c Examining data/nbdkit-1.22.3/filters/xz/blkcache.h Examining data/nbdkit-1.22.3/filters/nofilter/nofilter.c Examining data/nbdkit-1.22.3/filters/delay/delay.c Examining data/nbdkit-1.22.3/filters/error/error.c Examining data/nbdkit-1.22.3/filters/pause/pause.c Examining data/nbdkit-1.22.3/filters/tls-fallback/tls-fallback.c Examining data/nbdkit-1.22.3/filters/nocache/nocache.c Examining data/nbdkit-1.22.3/filters/rate/bucket.h Examining data/nbdkit-1.22.3/filters/rate/rate.c Examining data/nbdkit-1.22.3/filters/rate/bucket.c Examining data/nbdkit-1.22.3/filters/blocksize/blocksize.c Examining data/nbdkit-1.22.3/filters/offset/offset.c Examining data/nbdkit-1.22.3/filters/ddrescue/ddrescue.c Examining data/nbdkit-1.22.3/filters/limit/limit.c Examining data/nbdkit-1.22.3/filters/swab/swab.c Examining data/nbdkit-1.22.3/filters/cow/blk.c Examining data/nbdkit-1.22.3/filters/cow/blk.h Examining data/nbdkit-1.22.3/filters/cow/cow.c Examining data/nbdkit-1.22.3/filters/cache/blk.c Examining data/nbdkit-1.22.3/filters/cache/blk.h Examining data/nbdkit-1.22.3/filters/cache/lru.c Examining data/nbdkit-1.22.3/filters/cache/lru.h Examining data/nbdkit-1.22.3/filters/cache/reclaim.h Examining data/nbdkit-1.22.3/filters/cache/cache.h Examining data/nbdkit-1.22.3/filters/cache/cache.c Examining data/nbdkit-1.22.3/filters/cache/reclaim.c Examining data/nbdkit-1.22.3/filters/noparallel/noparallel.c Examining data/nbdkit-1.22.3/filters/truncate/truncate.c Examining data/nbdkit-1.22.3/filters/cacheextents/cacheextents.c Examining data/nbdkit-1.22.3/tests/test-tar-xz-curl.c Examining data/nbdkit-1.22.3/tests/test-read-password-plugin.c Examining data/nbdkit-1.22.3/tests/test-ocaml.c Examining data/nbdkit-1.22.3/tests/test.h Examining data/nbdkit-1.22.3/tests/web-server.c Examining data/nbdkit-1.22.3/tests/test-gzip-curl.c Examining data/nbdkit-1.22.3/tests/web-server.h Examining data/nbdkit-1.22.3/tests/test-ansi-c-plugin.c Examining data/nbdkit-1.22.3/tests/test-cc-cpp.cpp Examining data/nbdkit-1.22.3/tests/test-shutdown-plugin.c Examining data/nbdkit-1.22.3/tests/test-offset.c Examining data/nbdkit-1.22.3/tests/shebang.c Examining data/nbdkit-1.22.3/tests/test-split.c Examining data/nbdkit-1.22.3/tests/test-curl-cookie-script.c Examining data/nbdkit-1.22.3/tests/test-pause.c Examining data/nbdkit-1.22.3/tests/test-golang.c Examining data/nbdkit-1.22.3/tests/test-exit-with-parent.c Examining data/nbdkit-1.22.3/tests/test-tar-gzip-curl.c Examining data/nbdkit-1.22.3/tests/test-layers-plugin.c Examining data/nbdkit-1.22.3/tests/test-lang-plugins.c Examining data/nbdkit-1.22.3/tests/test-cxx-plugin.cpp Examining data/nbdkit-1.22.3/tests/dummy-vddk.c Examining data/nbdkit-1.22.3/tests/test-just-plugin-header.c Examining data/nbdkit-1.22.3/tests/test-file-block.c Examining data/nbdkit-1.22.3/tests/test-random.c Examining data/nbdkit-1.22.3/tests/test-nbd.c Examining data/nbdkit-1.22.3/tests/test-vddk.c Examining data/nbdkit-1.22.3/tests/test-connect.c Examining data/nbdkit-1.22.3/tests/test-xz.c Examining data/nbdkit-1.22.3/tests/test-delay.c Examining data/nbdkit-1.22.3/tests/test-xz-curl.c Examining data/nbdkit-1.22.3/tests/test-newstyle.c Examining data/nbdkit-1.22.3/tests/test-streaming.c Examining data/nbdkit-1.22.3/tests/test-null.c Examining data/nbdkit-1.22.3/tests/test-just-filter-header.c Examining data/nbdkit-1.22.3/tests/test-stdio-plugin.c Examining data/nbdkit-1.22.3/tests/test-tmpdisk.c Examining data/nbdkit-1.22.3/tests/test-layers-filter.c Examining data/nbdkit-1.22.3/tests/test-data.c Examining data/nbdkit-1.22.3/tests/test-curl.c Examining data/nbdkit-1.22.3/tests/test-ext2.c Examining data/nbdkit-1.22.3/tests/test-flush-plugin.c Examining data/nbdkit-1.22.3/tests/test-socket-activation.c Examining data/nbdkit-1.22.3/tests/test-cxx-filter.cpp Examining data/nbdkit-1.22.3/tests/test-curl-header-script.c Examining data/nbdkit-1.22.3/tests/test-oldstyle.c Examining data/nbdkit-1.22.3/tests/test-memory.c Examining data/nbdkit-1.22.3/tests/test-gzip.c Examining data/nbdkit-1.22.3/tests/test.c Examining data/nbdkit-1.22.3/tests/test-layers.c Examining data/nbdkit-1.22.3/common/utils/environ.c Examining data/nbdkit-1.22.3/common/utils/vector.c Examining data/nbdkit-1.22.3/common/utils/vector.h Examining data/nbdkit-1.22.3/common/utils/cleanup-nbdkit.c Examining data/nbdkit-1.22.3/common/utils/cleanup.c Examining data/nbdkit-1.22.3/common/utils/utils.h Examining data/nbdkit-1.22.3/common/utils/test-vector.c Examining data/nbdkit-1.22.3/common/utils/quote.c Examining data/nbdkit-1.22.3/common/utils/cleanup.h Examining data/nbdkit-1.22.3/common/utils/utils.c Examining data/nbdkit-1.22.3/common/utils/test-quotes.c Examining data/nbdkit-1.22.3/common/include/tvdiff.h Examining data/nbdkit-1.22.3/common/include/isaligned.h Examining data/nbdkit-1.22.3/common/include/test-ascii-string.c Examining data/nbdkit-1.22.3/common/include/ascii-string.h Examining data/nbdkit-1.22.3/common/include/iszero.h Examining data/nbdkit-1.22.3/common/include/nextnonzero.h Examining data/nbdkit-1.22.3/common/include/test-tvdiff.c Examining data/nbdkit-1.22.3/common/include/test-random.c Examining data/nbdkit-1.22.3/common/include/get-current-dir-name.h Examining data/nbdkit-1.22.3/common/include/random.h Examining data/nbdkit-1.22.3/common/include/test-byte-swapping.c Examining data/nbdkit-1.22.3/common/include/exit-with-parent.h Examining data/nbdkit-1.22.3/common/include/test-ispowerof2.c Examining data/nbdkit-1.22.3/common/include/test-nextnonzero.c Examining data/nbdkit-1.22.3/common/include/test-current-dir-name.c Examining data/nbdkit-1.22.3/common/include/rounding.h Examining data/nbdkit-1.22.3/common/include/unix-path-max.h Examining data/nbdkit-1.22.3/common/include/ispowerof2.h Examining data/nbdkit-1.22.3/common/include/test-minmax.c Examining data/nbdkit-1.22.3/common/include/byte-swapping.h Examining data/nbdkit-1.22.3/common/include/test-ascii-ctype.c Examining data/nbdkit-1.22.3/common/include/minmax.h Examining data/nbdkit-1.22.3/common/include/test-isaligned.c Examining data/nbdkit-1.22.3/common/include/test-iszero.c Examining data/nbdkit-1.22.3/common/include/ascii-ctype.h Examining data/nbdkit-1.22.3/common/bitmap/bitmap.c Examining data/nbdkit-1.22.3/common/bitmap/bitmap.h Examining data/nbdkit-1.22.3/common/bitmap/test-bitmap.c Examining data/nbdkit-1.22.3/common/allocators/allocator.c Examining data/nbdkit-1.22.3/common/allocators/zstd.c Examining data/nbdkit-1.22.3/common/allocators/malloc.c Examining data/nbdkit-1.22.3/common/allocators/allocator-internal.h Examining data/nbdkit-1.22.3/common/allocators/allocator.h Examining data/nbdkit-1.22.3/common/allocators/sparse.c Examining data/nbdkit-1.22.3/common/regions/regions.h Examining data/nbdkit-1.22.3/common/regions/regions.c Examining data/nbdkit-1.22.3/common/gpt/efi-crc32.h Examining data/nbdkit-1.22.3/common/gpt/efi-crc32.c Examining data/nbdkit-1.22.3/common/gpt/gpt.h Examining data/nbdkit-1.22.3/common/protocol/protostrings.c Examining data/nbdkit-1.22.3/common/protocol/protostrings.h Examining data/nbdkit-1.22.3/common/protocol/nbd-protocol.h FINAL RESULTS: data/nbdkit-1.22.3/plugins/sh/sh.c:123:7: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod (filename, 0500) == -1) { data/nbdkit-1.22.3/common/bitmap/test-bitmap.c:157:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, fs, args); data/nbdkit-1.22.3/common/include/test-tvdiff.c:52: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. fprintf (stderr, \ data/nbdkit-1.22.3/common/include/test-tvdiff.c:65: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. fprintf (stderr, \ data/nbdkit-1.22.3/filters/error/error.c:278:9: [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 (error_settings->file, F_OK) == -1) data/nbdkit-1.22.3/filters/ext2/io.c:199: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 (io->name, name); data/nbdkit-1.22.3/filters/extentlist/extentlist.c:176:14: [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. If the scanf format is influenceable by an attacker, it's exploitable. else if (sscanf (p, "%" SCNu32, &type) == 1) data/nbdkit-1.22.3/filters/log/log.c:150:37: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. static void __attribute__ ((format (printf, 4, 5))) data/nbdkit-1.22.3/filters/log/log.c:181:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (logfile, fmt, args); data/nbdkit-1.22.3/filters/tar/tar.c:200:8: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. fp = popen (cmd, "w"); data/nbdkit-1.22.3/filters/tar/tar.c:247:16: [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 the scanf format is influenceable by an attacker, it's exploitable. scanned_ok = fscanf (fp, "block %" SCNu64 ": %*s %*s %" SCNu64, data/nbdkit-1.22.3/plugins/cc/cc.c:126:7: [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. if (system (cmd) != 0) { data/nbdkit-1.22.3/plugins/cc/cc.c:228:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. r = system (command); data/nbdkit-1.22.3/plugins/cdi/cdi.c:121:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. r = system (command); data/nbdkit-1.22.3/plugins/cdi/cdi.c:126: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 (template, F_OK) != 0) { data/nbdkit-1.22.3/plugins/curl/curl.c:699:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (range, sizeof range, "%" PRIu64 "-%" PRIu64, data/nbdkit-1.22.3/plugins/curl/curl.c:763:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (range, sizeof range, "%" PRIu64 "-%" PRIu64, data/nbdkit-1.22.3/plugins/curl/scripts.c:201:8: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. fp = popen (cmd, "r"); data/nbdkit-1.22.3/plugins/curl/scripts.c:291:8: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. fp = popen (cmd, "r"); data/nbdkit-1.22.3/plugins/eval/call.c:94:5: [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. system (cmd); data/nbdkit-1.22.3/plugins/eval/call.c:239:5: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp (argv[0], (char **) argv); data/nbdkit-1.22.3/plugins/eval/methods.c:361:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); data/nbdkit-1.22.3/plugins/eval/methods.c:362:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (obuf, sizeof obuf, "%" PRIu64, offset); data/nbdkit-1.22.3/plugins/eval/methods.c:430: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 (*buf, str); data/nbdkit-1.22.3/plugins/eval/methods.c:447:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); data/nbdkit-1.22.3/plugins/eval/methods.c:448:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (obuf, sizeof obuf, "%" PRIu64, offset); data/nbdkit-1.22.3/plugins/eval/methods.c:720:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); data/nbdkit-1.22.3/plugins/eval/methods.c:721:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (obuf, sizeof obuf, "%" PRIu64, offset); data/nbdkit-1.22.3/plugins/eval/methods.c:754:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); data/nbdkit-1.22.3/plugins/eval/methods.c:755:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (obuf, sizeof obuf, "%" PRIu64, offset); data/nbdkit-1.22.3/plugins/eval/methods.c:825:14: [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. If the scanf format is influenceable by an attacker, it's exploitable. else if (sscanf (p, "%" SCNu32, &type) == 1) data/nbdkit-1.22.3/plugins/eval/methods.c:862:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); data/nbdkit-1.22.3/plugins/eval/methods.c:863:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (obuf, sizeof obuf, "%" PRIu64, offset); data/nbdkit-1.22.3/plugins/eval/methods.c:904:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); data/nbdkit-1.22.3/plugins/eval/methods.c:905:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (obuf, sizeof obuf, "%" PRIu64, offset); data/nbdkit-1.22.3/plugins/iso/iso.c:116:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. r = system (command); data/nbdkit-1.22.3/plugins/linuxdisk/filesystem.c:172:8: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. fp = popen (command, "r"); data/nbdkit-1.22.3/plugins/linuxdisk/filesystem.c:197:7: [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. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf (line, "%" SCNi64, &ret) != 1 || ret < 0) { data/nbdkit-1.22.3/plugins/linuxdisk/filesystem.c:222:3: [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 (fp, MKE2FS " -q -F -t %s ", type); data/nbdkit-1.22.3/plugins/linuxdisk/filesystem.c:240:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. r = system (command); data/nbdkit-1.22.3/plugins/ondemand/ondemand.c:258:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. r = system (cmd); data/nbdkit-1.22.3/plugins/sh/call.c:94:5: [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. system (cmd); data/nbdkit-1.22.3/plugins/sh/call.c:239:5: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp (argv[0], (char **) argv); data/nbdkit-1.22.3/plugins/sh/methods.c:361:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); data/nbdkit-1.22.3/plugins/sh/methods.c:362:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (obuf, sizeof obuf, "%" PRIu64, offset); data/nbdkit-1.22.3/plugins/sh/methods.c:430: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 (*buf, str); data/nbdkit-1.22.3/plugins/sh/methods.c:447:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); data/nbdkit-1.22.3/plugins/sh/methods.c:448:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (obuf, sizeof obuf, "%" PRIu64, offset); data/nbdkit-1.22.3/plugins/sh/methods.c:720:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); data/nbdkit-1.22.3/plugins/sh/methods.c:721:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (obuf, sizeof obuf, "%" PRIu64, offset); data/nbdkit-1.22.3/plugins/sh/methods.c:754:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); data/nbdkit-1.22.3/plugins/sh/methods.c:755:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (obuf, sizeof obuf, "%" PRIu64, offset); data/nbdkit-1.22.3/plugins/sh/methods.c:825:14: [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. If the scanf format is influenceable by an attacker, it's exploitable. else if (sscanf (p, "%" SCNu32, &type) == 1) data/nbdkit-1.22.3/plugins/sh/methods.c:862:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); data/nbdkit-1.22.3/plugins/sh/methods.c:863:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (obuf, sizeof obuf, "%" PRIu64, offset); data/nbdkit-1.22.3/plugins/sh/methods.c:904:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (cbuf, sizeof cbuf, "%" PRIu32, count); data/nbdkit-1.22.3/plugins/sh/methods.c:905:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (obuf, sizeof obuf, "%" PRIu64, offset); data/nbdkit-1.22.3/plugins/sh/sh.c:118:7: [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. if (system (cmd) != 0) { data/nbdkit-1.22.3/plugins/tar/tar.c:131:8: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. fp = popen (cmd, "r"); data/nbdkit-1.22.3/plugins/tar/tar.c:136:16: [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 the scanf format is influenceable by an attacker, it's exploitable. scanned_ok = fscanf (fp, "block %" SCNu64 ": %*s %*s %" SCNu64, data/nbdkit-1.22.3/plugins/tmpdisk/tmpdisk.c:245:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. r = system (cmd); data/nbdkit-1.22.3/plugins/torrent/torrent.cpp:142:7: [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. system (cmd); data/nbdkit-1.22.3/plugins/vddk/reexec.c:204:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp (exe_file, argv.ptr); data/nbdkit-1.22.3/server/captive.c:161:11: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. r = system (cmd); data/nbdkit-1.22.3/server/crypto.c:63:26: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format (printf, 2, 3))); data/nbdkit-1.22.3/server/crypto.c:73:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, fs, args); data/nbdkit-1.22.3/server/crypto.c:112: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 (ca_cert_filename, R_OK) == -1) data/nbdkit-1.22.3/server/crypto.c:114: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 (server_cert_filename, R_OK) == -1) data/nbdkit-1.22.3/server/crypto.c:116: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 (server_key_filename, R_OK) == -1) data/nbdkit-1.22.3/server/crypto.c:133: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 (ca_crl_filename, R_OK) == 0) { data/nbdkit-1.22.3/server/debug.c:75:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, fs, args); data/nbdkit-1.22.3/server/debug.c:101:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, fs, args); data/nbdkit-1.22.3/server/internal.h:317:30: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((__format__ (printf, 1, 0))); data/nbdkit-1.22.3/server/internal.h:319:30: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((__format__ (printf, 1, 0))); data/nbdkit-1.22.3/server/internal.h:324:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define vfprintf replace_vfprintf data/nbdkit-1.22.3/server/internal.h:326:30: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((__format__ (printf, 2, 0))); data/nbdkit-1.22.3/server/log-stderr.c:71:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, fs, args); data/nbdkit-1.22.3/server/log-syslog.c:76:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (fp, fs, args); data/nbdkit-1.22.3/server/main.c:564:7: [4] (shell) execv: 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. execv (script, argv); data/nbdkit-1.22.3/server/protocol-handshake-newstyle.c:191:36: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. static int __attribute__ ((format (printf, 3, 4))) data/nbdkit-1.22.3/server/test-public.c:175: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. fprintf (stderr, \ data/nbdkit-1.22.3/server/test-public.c:181: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. fprintf (stderr, \ data/nbdkit-1.22.3/server/vfprintf.c:45:8: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #undef vfprintf data/nbdkit-1.22.3/server/vfprintf.c:61:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. ret = vfprintf (f, fmt, args); data/nbdkit-1.22.3/tests/test-exit-with-parent.c:100:7: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp ("nbdkit", (char **) argv); data/nbdkit-1.22.3/tests/test-exit-with-parent.c:126:11: [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 (pidpath, F_OK) == 0) data/nbdkit-1.22.3/tests/test-file-block.c:71:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. r = system ("losetup --version"); data/nbdkit-1.22.3/tests/test-file-block.c:92:8: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. pp = popen (cmd, "r"); data/nbdkit-1.22.3/tests/test-file-block.c:122: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 (loopdev, buf); data/nbdkit-1.22.3/tests/test-file-block.c:217:3: [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. system (cmd); data/nbdkit-1.22.3/tests/test-golang.c:66: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 (plugin, R_OK) == -1) { data/nbdkit-1.22.3/tests/test-gzip-curl.c:60: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 (disk, F_OK) == -1) { data/nbdkit-1.22.3/tests/test-gzip.c:53: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 (disk, F_OK) == -1) { data/nbdkit-1.22.3/tests/test-layers.c:131:5: [4] (shell) execlp: 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. execlp ("nbdkit", "nbdkit", data/nbdkit-1.22.3/tests/test-pause.c:97: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 (addr.sun_path, SOCKET); data/nbdkit-1.22.3/tests/test-socket-activation.c:158:5: [4] (shell) execlp: 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. execlp ("nbdkit", data/nbdkit-1.22.3/tests/test-socket-activation.c:192:9: [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 (pidpath, F_OK) == 0) data/nbdkit-1.22.3/tests/test-streaming.c:104:5: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp ("md5sum", exec_argv); data/nbdkit-1.22.3/tests/test-tar-gzip-curl.c:60: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 (disk, F_OK) == -1) { data/nbdkit-1.22.3/tests/test-tar-xz-curl.c:60: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 (disk, F_OK) == -1) { data/nbdkit-1.22.3/tests/test-xz-curl.c:60: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 (disk, F_OK) == -1) { data/nbdkit-1.22.3/tests/test-xz.c:54: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 (disk, F_OK) == -1) { data/nbdkit-1.22.3/tests/test.c:175:5: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp ("nbdkit", (char **) argv); data/nbdkit-1.22.3/tests/test.c:213:9: [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 (kit->pidpath, F_OK) == 0) data/nbdkit-1.22.3/tests/web-server.c:264: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. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf (p, "%" SCNu64 "-%" SCNu64, &offset, &end) != 2) { data/nbdkit-1.22.3/wrapper.c:101:36: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. static void __attribute__((format (printf, 1, 2))) data/nbdkit-1.22.3/wrapper.c:298:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp (cmd[0], (char **) cmd); data/nbdkit-1.22.3/filters/cache/blk.c:100: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. tmpdir = getenv ("TMPDIR"); data/nbdkit-1.22.3/filters/cow/blk.c:106: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. tmpdir = getenv ("TMPDIR"); data/nbdkit-1.22.3/filters/gzip/gzip.c:150: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. tmpdir = getenv ("TMPDIR"); data/nbdkit-1.22.3/plugins/cdi/cdi.c:89: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. tmpdir = getenv ("TMPDIR"); data/nbdkit-1.22.3/plugins/iso/iso.c:76: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. tmpdir = getenv ("TMPDIR"); data/nbdkit-1.22.3/plugins/linuxdisk/filesystem.c:101: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. tmpdir = getenv ("TMPDIR"); data/nbdkit-1.22.3/plugins/tmpdisk/tmpdisk.c:74:7: [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. s = getenv ("TMPDIR"); data/nbdkit-1.22.3/plugins/torrent/torrent.cpp:264:26: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char *tmpdir = getenv ("TMPDIR") ? : LARGE_TMPDIR; data/nbdkit-1.22.3/plugins/vddk/reexec.c:213:21: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char *env = getenv ("LD_LIBRARY_PATH"); data/nbdkit-1.22.3/plugins/vddk/reexec.c:240: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. char *env = getenv ("LD_LIBRARY_PATH"); data/nbdkit-1.22.3/server/crypto.c:165:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. home = getenv ("HOME"); data/nbdkit-1.22.3/server/crypto.c:207:18: [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. abs_psk_file = realpath (tls_psk, NULL); data/nbdkit-1.22.3/server/main.c:138:31: [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. CLEANUP_FREE char *binary = realpath ("/proc/self/exe", NULL); data/nbdkit-1.22.3/server/main.c:214:9: [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. c = getopt_long (argc, argv, short_options, long_options, NULL); data/nbdkit-1.22.3/server/public.c:104:9: [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. ret = realpath (path, NULL); data/nbdkit-1.22.3/server/socket-activation.c:60:7: [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. s = getenv ("LISTEN_PID"); data/nbdkit-1.22.3/server/socket-activation.c:71:7: [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. s = getenv ("LISTEN_FDS"); data/nbdkit-1.22.3/tests/dummy-vddk.c:124:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv ("DUMMY_VDDK_PRINT_PASSWORD") && data/nbdkit-1.22.3/tests/test-golang.c:59:7: [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. s = getenv ("NBDKIT_VALGRIND"); data/nbdkit-1.22.3/tests/test-lang-plugins.c:57:7: [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. s = getenv ("NBDKIT_VALGRIND"); data/nbdkit-1.22.3/tests/test-vddk.c:55:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv ("NBDKIT_VALGRIND")) { data/nbdkit-1.22.3/tests/test.c:90: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. s = getenv ("NBDKIT_VALGRIND"); data/nbdkit-1.22.3/wrapper.c:149:7: [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. s = getenv ("NBDKIT_VALGRIND"); data/nbdkit-1.22.3/wrapper.c:164:9: [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. s = getenv ("NBDKIT_GDB"); data/nbdkit-1.22.3/wrapper.c:172:7: [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. s = getenv ("LD_LIBRARY_PATH"); data/nbdkit-1.22.3/wrapper.c:183:7: [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. s = getenv ("LIBRARY_PATH"); data/nbdkit-1.22.3/wrapper.c:207:9: [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. c = getopt_long (argc, argv, short_options, long_options, &long_index); data/nbdkit-1.22.3/common/allocators/malloc.c:163: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 (buf, ma->ba.ptr + offset, ma->ba.alloc - offset); data/nbdkit-1.22.3/common/allocators/malloc.c:167: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 (buf, ma->ba.ptr + offset, count); data/nbdkit-1.22.3/common/allocators/malloc.c:186: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 (ma->ba.ptr + offset, buf, count); data/nbdkit-1.22.3/common/allocators/sparse.c:315:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (buf, p, n); data/nbdkit-1.22.3/common/allocators/sparse.c:341: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 (p, buf, n); data/nbdkit-1.22.3/common/allocators/zstd.c:375: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 (buf, p, n); data/nbdkit-1.22.3/common/allocators/zstd.c:406: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 (p, buf, n); data/nbdkit-1.22.3/common/gpt/gpt.h:37: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 signature[8]; data/nbdkit-1.22.3/common/gpt/gpt.h:38: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 revision[4]; data/nbdkit-1.22.3/common/gpt/gpt.h:46: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 guid[16]; data/nbdkit-1.22.3/common/gpt/gpt.h:57: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 partition_type_guid[16]; data/nbdkit-1.22.3/common/gpt/gpt.h:58: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 unique_guid[16]; data/nbdkit-1.22.3/common/gpt/gpt.h:62:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[72]; /* UTF-16LE */ data/nbdkit-1.22.3/common/include/test-byte-swapping.c:61: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 (&i16, le16, 2); data/nbdkit-1.22.3/common/include/test-byte-swapping.c:63: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 (&i32, le32, 4); data/nbdkit-1.22.3/common/include/test-byte-swapping.c:65: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 (&i64, le64, 8); data/nbdkit-1.22.3/common/include/test-byte-swapping.c:68: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 (&i16, be16, 2); data/nbdkit-1.22.3/common/include/test-byte-swapping.c:70: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 (&i32, be32, 4); data/nbdkit-1.22.3/common/include/test-byte-swapping.c:72: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 (&i64, be64, 8); data/nbdkit-1.22.3/common/include/test-byte-swapping.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 (&i16, le16, 2); data/nbdkit-1.22.3/common/include/test-byte-swapping.c:95: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 (&i32, le32, 4); data/nbdkit-1.22.3/common/include/test-byte-swapping.c:101: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 (&i64, le64, 8); data/nbdkit-1.22.3/common/include/test-nextnonzero.c:44: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 buf[256]; data/nbdkit-1.22.3/common/protocol/nbd-protocol.h:58: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 zeroes[124]; /* must be sent as zero bytes */ data/nbdkit-1.22.3/common/protocol/nbd-protocol.h:87: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 zeroes[124]; /* optional zeroes, unless NBD_FLAG_NO_ZEROES */ data/nbdkit-1.22.3/filters/blocksize/blocksize.c:55: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 bounce[BLOCKSIZE_MIN_LIMIT]; data/nbdkit-1.22.3/filters/blocksize/blocksize.c:187: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 (buf, bounce + drop, keep); data/nbdkit-1.22.3/filters/blocksize/blocksize.c:207: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 (buf, bounce, count); data/nbdkit-1.22.3/filters/blocksize/blocksize.c:235: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 (bounce + drop, buf, keep); data/nbdkit-1.22.3/filters/blocksize/blocksize.c:258: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 (bounce, buf, count); data/nbdkit-1.22.3/filters/cache/blk.c:116:8: [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 (template); data/nbdkit-1.22.3/filters/cache/cache.c:292: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 (buf, &block[blkoffs], n); data/nbdkit-1.22.3/filters/cache/cache.c:327: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 (buf, block, count); data/nbdkit-1.22.3/filters/cache/cache.c:373:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&block[blkoffs], buf, n); data/nbdkit-1.22.3/filters/cache/cache.c:404:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (block, buf, count); data/nbdkit-1.22.3/filters/cow/blk.c:122:8: [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 (template); data/nbdkit-1.22.3/filters/cow/cow.c:234: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 (buf, &block[blkoffs], n); data/nbdkit-1.22.3/filters/cow/cow.c:269: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 (buf, block, count); data/nbdkit-1.22.3/filters/cow/cow.c:308:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&block[blkoffs], buf, n); data/nbdkit-1.22.3/filters/cow/cow.c:339:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (block, buf, count); data/nbdkit-1.22.3/filters/ddrescue/ddrescue.c:73:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen (filename, "r"); data/nbdkit-1.22.3/filters/extentlist/extentlist.c:137:8: [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 (extentlist, "r"); data/nbdkit-1.22.3/filters/gzip/gzip.c:162:8: [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 (template); data/nbdkit-1.22.3/filters/ip/ip.c:71: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 addr4[INET_ADDRSTRLEN]; data/nbdkit-1.22.3/filters/ip/ip.c:72: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 addr6[INET6_ADDRSTRLEN]; data/nbdkit-1.22.3/filters/ip/ip.c:138: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 addr[MAX_ADDRLEN+1]; data/nbdkit-1.22.3/filters/ip/ip.c:167:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAX_LEN+1]; data/nbdkit-1.22.3/filters/log/log.c:113: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 (logfilename, data/nbdkit-1.22.3/filters/log/log.c:156: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 timestamp[27] = "Time unknown"; data/nbdkit-1.22.3/filters/nozero/nozero.c:189:24: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static /* const */ char buffer[MAX_WRITE]; data/nbdkit-1.22.3/filters/partition/partition-gpt.c:63: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 (partition_type_guid, entry->partition_type_guid, 16); data/nbdkit-1.22.3/filters/partition/partition-mbr.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 (&part->start_sector, §or[offset+8], 4); data/nbdkit-1.22.3/filters/partition/partition-mbr.c:66: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 (&part->nr_sectors, §or[offset+0xC], 4); data/nbdkit-1.22.3/filters/pause/pause.c:116: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 (addr.sun_path, sockfile, len+1 /* trailing \0 */); data/nbdkit-1.22.3/filters/rate/rate.c:215: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 (file, O_CLOEXEC | O_RDONLY); data/nbdkit-1.22.3/filters/readahead/readahead.c:180:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (buf, &buffer[offset-position], n); data/nbdkit-1.22.3/filters/retry/retry.c:111: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). bool open; data/nbdkit-1.22.3/filters/retry/retry.c:234:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (! (h->open && valid_range (next_ops, nxdata, count, offset, false, err))) data/nbdkit-1.22.3/filters/retry/retry.c:260:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (! (h->open && valid_range (next_ops, nxdata, count, offset, true, err))) data/nbdkit-1.22.3/filters/retry/retry.c:295:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (! (h->open && valid_range (next_ops, nxdata, count, offset, true, err))) data/nbdkit-1.22.3/filters/retry/retry.c:325:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (! h->open) data/nbdkit-1.22.3/filters/retry/retry.c:356: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). (! h->open || next_ops->can_fast_zero (nxdata) != 1)) { data/nbdkit-1.22.3/filters/retry/retry.c:360:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (! (h->open && valid_range (next_ops, nxdata, count, offset, true, err))) data/nbdkit-1.22.3/filters/retry/retry.c:393:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (! (h->open && valid_range (next_ops, nxdata, count, offset, false, err))) data/nbdkit-1.22.3/filters/retry/retry.c:439:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (! h->open && (valid_range (next_ops, nxdata, count, offset, false, err))) data/nbdkit-1.22.3/filters/stats/stats.c:223: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 (filename, data/nbdkit-1.22.3/filters/tar/tar.c:157:8: [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 (output); data/nbdkit-1.22.3/filters/tar/tar.c:242:8: [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 (output, "r"); data/nbdkit-1.22.3/filters/tls-fallback/tls-fallback.c:47: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 message[512] NONSTRING = "This NBD server requires TLS " data/nbdkit-1.22.3/filters/tls-fallback/tls-fallback.c:174: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 (b, message + offs, count); data/nbdkit-1.22.3/filters/xz/blkcache.c:144: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 (ret, &c->stats, sizeof (c->stats)); data/nbdkit-1.22.3/filters/xz/xz.c:232: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 (buf, &data[offset-start], n); data/nbdkit-1.22.3/filters/xz/xzfile.c:117:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[XZ_HEADER_MAGIC_LEN]; data/nbdkit-1.22.3/include/nbdkit-filter.h:188:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). void * (*open) (nbdkit_next_open *next, nbdkit_backend *nxdata, data/nbdkit-1.22.3/include/nbdkit-plugin.h:78:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). void * (*open) (int readonly); data/nbdkit-1.22.3/plugins/cc/cc.c:191:8: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). char tmpfile[] = "/tmp/ccXXXXXX.so"; data/nbdkit-1.22.3/plugins/cc/cc.c:202:18: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). fd = mkstemps (tmpfile, 3); data/nbdkit-1.22.3/plugins/cc/cc.c:221:16: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). shell_quote (tmpfile, fp); data/nbdkit-1.22.3/plugins/cc/cc.c:230:13: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). unlink (tmpfile); data/nbdkit-1.22.3/plugins/cc/cc.c:235:16: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). dl = dlopen (tmpfile, RTLD_NOW); data/nbdkit-1.22.3/plugins/cc/cc.c:236:11: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). unlink (tmpfile); data/nbdkit-1.22.3/plugins/cc/cc.c:272: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 (&subplugin, ptr, size); data/nbdkit-1.22.3/plugins/cc/cc.c:354:20: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). return subplugin.open (readonly); data/nbdkit-1.22.3/plugins/cdi/cdi.c:97:8: [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 (template); data/nbdkit-1.22.3/plugins/cdi/cdi.c:133: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 (template, O_RDONLY|O_CLOEXEC); data/nbdkit-1.22.3/plugins/curl/curl.c:588: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 (str, data, size); data/nbdkit-1.22.3/plugins/curl/curl.c:685: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 range[128]; data/nbdkit-1.22.3/plugins/curl/curl.c:735: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 (h->write_buf, ptr, realsize); data/nbdkit-1.22.3/plugins/curl/curl.c:749: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 range[128]; data/nbdkit-1.22.3/plugins/curl/curl.c:794: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 (ptr, h->read_buf, realsize); data/nbdkit-1.22.3/plugins/curl/curldefs.h:64: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 errbuf[CURL_ERROR_SIZE]; data/nbdkit-1.22.3/plugins/curl/scripts.c:159:8: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). char tmpfile[] = "/tmp/errorsXXXXXX"; data/nbdkit-1.22.3/plugins/curl/scripts.c:173:8: [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 (tmpfile); data/nbdkit-1.22.3/plugins/curl/scripts.c:173:17: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). fd = mkstemp (tmpfile); data/nbdkit-1.22.3/plugins/curl/scripts.c:187:31: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). fprintf (fp, "exec 2>%s\n", tmpfile); /* Catch errors to a temporary file. */ data/nbdkit-1.22.3/plugins/curl/scripts.c:227: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). fp = fopen (tmpfile, "r"); data/nbdkit-1.22.3/plugins/curl/scripts.c:227:17: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). fp = fopen (tmpfile, "r"); data/nbdkit-1.22.3/plugins/curl/scripts.c:249:8: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). char tmpfile[] = "/tmp/errorsXXXXXX"; data/nbdkit-1.22.3/plugins/curl/scripts.c:263:8: [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 (tmpfile); data/nbdkit-1.22.3/plugins/curl/scripts.c:263:17: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). fd = mkstemp (tmpfile); data/nbdkit-1.22.3/plugins/curl/scripts.c:277:31: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). fprintf (fp, "exec 2>%s\n", tmpfile); /* Catch errors to a temporary file. */ data/nbdkit-1.22.3/plugins/curl/scripts.c:316: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). fp = fopen (tmpfile, "r"); data/nbdkit-1.22.3/plugins/curl/scripts.c:316:17: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). fp = fopen (tmpfile, "r"); data/nbdkit-1.22.3/plugins/data/format.c:57:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BUFSIZ]; data/nbdkit-1.22.3/plugins/data/format.c:60:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen (filename, "r"); data/nbdkit-1.22.3/plugins/eval/eval.c:173:8: [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 (script, "w"); data/nbdkit-1.22.3/plugins/eval/methods.c:356: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 cbuf[32], obuf[32]; data/nbdkit-1.22.3/plugins/eval/methods.c:373: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 (buf, data, count); data/nbdkit-1.22.3/plugins/eval/methods.c:444: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 cbuf[32], obuf[32], fbuf[32]; data/nbdkit-1.22.3/plugins/eval/methods.c:717: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 cbuf[32], obuf[32], fbuf[32]; data/nbdkit-1.22.3/plugins/eval/methods.c:751: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 cbuf[32], obuf[32], fbuf[32]; data/nbdkit-1.22.3/plugins/eval/methods.c:856: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 cbuf[32], obuf[32], fbuf[32]; data/nbdkit-1.22.3/plugins/eval/methods.c:901: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 cbuf[32], obuf[32]; data/nbdkit-1.22.3/plugins/example1/example1.c:49:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char bootsector[512] = { data/nbdkit-1.22.3/plugins/example1/example1.c:115:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char data[104857600]; data/nbdkit-1.22.3/plugins/example1/example1.c:124: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, bootsector, sizeof bootsector); data/nbdkit-1.22.3/plugins/example1/example1.c:160: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 (buf, data+offset, count); data/nbdkit-1.22.3/plugins/example2/example2.c:136: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). h->fd = open (filename, O_RDONLY|O_CLOEXEC); data/nbdkit-1.22.3/plugins/example3/example3.c:118:11: [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). h->fd = mkstemp (template); data/nbdkit-1.22.3/plugins/file/file.c:272: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). dfd = open (directory, O_RDONLY | O_DIRECTORY | O_CLOEXEC); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:60: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 short_base[8]; /* Short basename. */ data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:61: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 short_ext[3]; /* Short file extension. */ data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:224: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 (out, label, len <= n ? len : n); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:266:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (s, &lfn->lfn[byte_offset], 26); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:268:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (s, &lfn->lfn[byte_offset], r); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:284: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 (lfn_entry.name1, &s[0], 5*2); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:285: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 (lfn_entry.name2, &s[5], 6*2); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:286: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 (lfn_entry.name3, &s[11], 2*2); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:295: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 (entry.name, lfn->short_base, 8); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:296: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 (entry.name+8, lfn->short_ext, 3); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:385: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 (lfns[i].short_base, lfn->name, len <= 8 ? len : 8); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:393:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (lfn->short_ext, p, len <= 3 ? len : 3); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:428: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 s[9]; data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:440:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&lfn->short_base[k], s, len); data/nbdkit-1.22.3/plugins/floppy/floppy.c:166:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (host_path, O_RDONLY|O_CLOEXEC); data/nbdkit-1.22.3/plugins/floppy/floppy.c:187:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (buf, ®ion->u.data[offset - region->start], len); data/nbdkit-1.22.3/plugins/floppy/virtual-floppy.c:444: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 (floppy->mbr.oem_name, OEM_NAME, sizeof floppy->mbr.oem_name); data/nbdkit-1.22.3/plugins/floppy/virtual-floppy.c:477: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 (floppy->bootsect.oem_name, OEM_NAME, data/nbdkit-1.22.3/plugins/floppy/virtual-floppy.c:508: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 (floppy->bootsect.fstype, "FAT32 ", 8); data/nbdkit-1.22.3/plugins/guestfs/guestfs-plugin.c:529: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 (buf, data, size); data/nbdkit-1.22.3/plugins/gzip/gzip.c:115:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BUFSIZ]; data/nbdkit-1.22.3/plugins/info/info.c:180: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 straddr[INET_ADDRSTRLEN]; data/nbdkit-1.22.3/plugins/info/info.c:181: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 straddr6[INET6_ADDRSTRLEN]; data/nbdkit-1.22.3/plugins/info/info.c:416: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[0], &secs, 8); data/nbdkit-1.22.3/plugins/info/info.c:417: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[8], &usecs, 4); data/nbdkit-1.22.3/plugins/info/info.c:431: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 (buf, h->data + offset, count); data/nbdkit-1.22.3/plugins/iso/iso.c:84:8: [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 (template); data/nbdkit-1.22.3/plugins/linuxdisk/filesystem.c:109:8: [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 (filename); data/nbdkit-1.22.3/plugins/linuxdisk/linuxdisk.c:209:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (buf, ®ion->u.data[offset - region->start], len); data/nbdkit-1.22.3/plugins/linuxdisk/partition-gpt.c:109: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 (&out[8], &u32, 4); data/nbdkit-1.22.3/plugins/linuxdisk/partition-gpt.c:111: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 (&out[12], &u32, 4); data/nbdkit-1.22.3/plugins/linuxdisk/partition-gpt.c:178:35: [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 partition_type_guid[16], data/nbdkit-1.22.3/plugins/linuxdisk/partition-gpt.c:179:35: [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 guid[16], data/nbdkit-1.22.3/plugins/linuxdisk/partition-gpt.c:186: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 (entry->partition_type_guid, partition_type_guid, 16); data/nbdkit-1.22.3/plugins/linuxdisk/partition-gpt.c:187: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 (entry->unique_guid, guid, 16); data/nbdkit-1.22.3/plugins/linuxdisk/virtual-disk.h:71: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 guid[16]; data/nbdkit-1.22.3/plugins/lua/lua.c:299: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 (buf, str, count); data/nbdkit-1.22.3/plugins/nbd/nbd.c:425:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[10]; /* Larger than 1 to allow reduction of any backlog */ data/nbdkit-1.22.3/plugins/ocaml/ocaml.c:60: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 ((char *) String_val (sv), p, len); data/nbdkit-1.22.3/plugins/ocaml/ocaml.c:72: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 *argv[2] = { "nbdkit", NULL }; data/nbdkit-1.22.3/plugins/ocaml/ocaml.c:631: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 (buf, String_val (rv), count); data/nbdkit-1.22.3/plugins/ocaml/ocaml.c:859:5: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). SET(open) data/nbdkit-1.22.3/plugins/ocaml/ocaml.c:903: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). REMOVE (open); data/nbdkit-1.22.3/plugins/partitioning/partition-gpt.c:57:47: [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 partition_type_guid[16], data/nbdkit-1.22.3/plugins/partitioning/partition-gpt.c:142:35: [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 partition_type_guid[16], data/nbdkit-1.22.3/plugins/partitioning/partition-gpt.c:151: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 (entry->partition_type_guid, partition_type_guid, 16); data/nbdkit-1.22.3/plugins/partitioning/partition-gpt.c:153: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 (entry->unique_guid, the_files.ptr[region->u.i].guid, 16); data/nbdkit-1.22.3/plugins/partitioning/partition-mbr.c:207: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 (&out[8], &u32, 4); data/nbdkit-1.22.3/plugins/partitioning/partition-mbr.c:209: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 (&out[12], &u32, 4); data/nbdkit-1.22.3/plugins/partitioning/partitioning.c:74: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 type_guid[16]; /* initialized by partitioning_load function below */ data/nbdkit-1.22.3/plugins/partitioning/partitioning.c:137: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 (file.type_guid, type_guid, sizeof type_guid); data/nbdkit-1.22.3/plugins/partitioning/partitioning.c:139: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). file.fd = open (file.filename, O_RDWR); data/nbdkit-1.22.3/plugins/partitioning/partitioning.c:346:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (buf, ®ion->u.data[offset - region->start], len); data/nbdkit-1.22.3/plugins/partitioning/virtual-disk.h:73: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 type_guid[16]; data/nbdkit-1.22.3/plugins/partitioning/virtual-disk.h:85: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 guid[16]; /* random GUID used for GPT */ data/nbdkit-1.22.3/plugins/partitioning/virtual-disk.h:88: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 type_guid[16]; /* partition type GUID of this partition */ data/nbdkit-1.22.3/plugins/pattern/pattern.c:121: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 (b, (char *)&d + o, n); data/nbdkit-1.22.3/plugins/perl/perl.c:64: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. const char *argv[2] = { "nbdkit", NULL }; data/nbdkit-1.22.3/plugins/perl/perl.c:225: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 *argv[3] = { "nbdkit", NULL, NULL }; data/nbdkit-1.22.3/plugins/perl/perl.c:509: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 (buf, pbuf, count); data/nbdkit-1.22.3/plugins/python/python.c:414: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 (script, O_CLOEXEC | O_RDONLY); data/nbdkit-1.22.3/plugins/python/python.c:677: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 (buf, view.buf, count); data/nbdkit-1.22.3/plugins/ruby/ruby.c:348: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 (buf, RSTRING_PTR (rv), count); data/nbdkit-1.22.3/plugins/sh/methods.c:356: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 cbuf[32], obuf[32]; data/nbdkit-1.22.3/plugins/sh/methods.c:373: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 (buf, data, count); data/nbdkit-1.22.3/plugins/sh/methods.c:444: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 cbuf[32], obuf[32], fbuf[32]; data/nbdkit-1.22.3/plugins/sh/methods.c:717: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 cbuf[32], obuf[32], fbuf[32]; data/nbdkit-1.22.3/plugins/sh/methods.c:751: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 cbuf[32], obuf[32], fbuf[32]; data/nbdkit-1.22.3/plugins/sh/methods.c:856: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 cbuf[32], obuf[32], fbuf[32]; data/nbdkit-1.22.3/plugins/sh/methods.c:901: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 cbuf[32], obuf[32]; data/nbdkit-1.22.3/plugins/split/split.c:137:22: [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). h->files[i].fd = open (filenames.ptr[i], flags); data/nbdkit-1.22.3/plugins/streaming/streaming.c:151: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 (filename, flags); data/nbdkit-1.22.3/plugins/streaming/streaming.c:231:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char discard[4096]; data/nbdkit-1.22.3/plugins/streaming/streaming.c:318:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char zerobuf[4096]; data/nbdkit-1.22.3/plugins/tar/tar.c:112: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 s[256]; data/nbdkit-1.22.3/plugins/tar/tar.c:188: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). h->fd = open (tarfile, (readonly ? O_RDONLY : O_RDWR) | O_CLOEXEC); data/nbdkit-1.22.3/plugins/tcl/tcl.c:302: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 (buf, res_bin, count); data/nbdkit-1.22.3/plugins/tmpdisk/tmpdisk.c:328: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). h->fd = open (disk, flags); data/nbdkit-1.22.3/plugins/torrent/torrent.cpp:466: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). while ((fd = open (path, O_RDONLY | O_CLOEXEC)) == -1) { data/nbdkit-1.22.3/plugins/vddk/reexec.c:96:8: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). char tmpfile[] = "/tmp/XXXXXX"; data/nbdkit-1.22.3/plugins/vddk/reexec.c:105: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 (cmdline_file, O_RDONLY|O_CLOEXEC); data/nbdkit-1.22.3/plugins/vddk/reexec.c:162:10: [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 (tmpfile); data/nbdkit-1.22.3/plugins/vddk/reexec.c:162:19: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). fd = mkstemp (tmpfile); data/nbdkit-1.22.3/plugins/vddk/reexec.c:167:13: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). unlink (tmpfile); data/nbdkit-1.22.3/plugins/vddk/vddk-structs.h:101: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 reserved4[8]; data/nbdkit-1.22.3/server/backend.c:222: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). h->handle = b->open (b, readonly, exportname, conn->using_tls); data/nbdkit-1.22.3/server/backend.c:694:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[MAX_REQUEST_SIZE]; /* data sink, never read */ data/nbdkit-1.22.3/server/filters.c:262:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (f->filter.open) data/nbdkit-1.22.3/server/filters.c:263:24: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). handle = f->filter.open (backend_open, b->next, readonly, exportname, data/nbdkit-1.22.3/server/fuzzer.c:150: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 rbuf[512]; data/nbdkit-1.22.3/server/internal.h:370: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). void *(*open) (struct backend *, int readonly, const char *exportname, data/nbdkit-1.22.3/server/main.c:945: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 pidstr[64]; data/nbdkit-1.22.3/server/main.c:955: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 (pidfile, O_WRONLY|O_TRUNC|O_CREAT|O_CLOEXEC|O_NOCTTY, 0644); data/nbdkit-1.22.3/server/main.c:1045: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). if (open ("/dev/null", O_RDONLY) != STDIN_FILENO || data/nbdkit-1.22.3/server/main.c:1046: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). open ("/dev/null", O_WRONLY) != STDOUT_FILENO) { data/nbdkit-1.22.3/server/plugins.c:166: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). HAS (open); data/nbdkit-1.22.3/server/plugins.c:298:21: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). assert (p->plugin.open != NULL); data/nbdkit-1.22.3/server/plugins.c:319:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). r = p->plugin.open (readonly); data/nbdkit-1.22.3/server/plugins.c:683:24: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static /* const */ char buf[MAX_REQUEST_SIZE]; data/nbdkit-1.22.3/server/plugins.c:827: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->plugin, plugin, size); data/nbdkit-1.22.3/server/protocol-handshake-newstyle.c:472:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&exportnamelen, &data[0], 4); data/nbdkit-1.22.3/server/protocol-handshake-newstyle.c:481:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&nrinfos, &data[exportnamelen+4], 2); data/nbdkit-1.22.3/server/protocol-handshake-newstyle.c:535:11: [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 (&info, &data[4 + exportnamelen + 2 + i*2], 2); data/nbdkit-1.22.3/server/protocol-handshake-newstyle.c:632:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&exportnamelen, &data[0], 4); data/nbdkit-1.22.3/server/protocol-handshake-newstyle.c:658:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&nr_queries, &data[opt_index], 4); data/nbdkit-1.22.3/server/protocol-handshake-newstyle.c:688: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 (&querylen, &data[opt_index], 4); data/nbdkit-1.22.3/server/protocol.c:298:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BUFSIZ]; data/nbdkit-1.22.3/server/public.c:448: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 (&value[1], O_RDONLY | O_CLOEXEC); data/nbdkit-1.22.3/server/sockets.c:130: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 (addr.sun_path, unixsocket, len+1 /* trailing \0 */); data/nbdkit-1.22.3/server/test-public.c:343: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 fdbuf[16]; data/nbdkit-1.22.3/server/test-public.c:376:8: [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 (&template[1]); data/nbdkit-1.22.3/server/test-public.c:401:8: [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 (template2); data/nbdkit-1.22.3/tests/dummy-vddk.c:54: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 disk[CAPACITY * VIXDISKLIB_SECTOR_SIZE]; data/nbdkit-1.22.3/tests/dummy-vddk.c:185: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 (buf, disk + offset, nr_sectors * VIXDISKLIB_SECTOR_SIZE); data/nbdkit-1.22.3/tests/dummy-vddk.c:196: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 + offset, buf, nr_sectors * VIXDISKLIB_SECTOR_SIZE); data/nbdkit-1.22.3/tests/shebang.c:10: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 data[100*1024*1024]; data/nbdkit-1.22.3/tests/shebang.c:31: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 (buf, data+offset, count); data/nbdkit-1.22.3/tests/shebang.c:40: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+offset, buf, count); data/nbdkit-1.22.3/tests/test-ansi-c-plugin.c:51:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char bootsector[512] = { data/nbdkit-1.22.3/tests/test-ansi-c-plugin.c:117:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char data[104857600]; data/nbdkit-1.22.3/tests/test-ansi-c-plugin.c:122: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, bootsector, sizeof bootsector); data/nbdkit-1.22.3/tests/test-ansi-c-plugin.c:142: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 (buf, data+offset, count); data/nbdkit-1.22.3/tests/test-cc-cpp.cpp:44:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char bootsector[512] = { data/nbdkit-1.22.3/tests/test-cc-cpp.cpp:110:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char data[104857600]; data/nbdkit-1.22.3/tests/test-cc-cpp.cpp:115: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, bootsector, sizeof bootsector); data/nbdkit-1.22.3/tests/test-cc-cpp.cpp: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 (buf, data+offset, count); data/nbdkit-1.22.3/tests/test-curl-cookie-script.c:58: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 expected[64]; data/nbdkit-1.22.3/tests/test-curl-cookie-script.c:70: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 buf[512]; data/nbdkit-1.22.3/tests/test-curl-header-script.c:60: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 expected[64]; data/nbdkit-1.22.3/tests/test-curl-header-script.c:92: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 buf[512]; data/nbdkit-1.22.3/tests/test-cxx-plugin.cpp:46:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char bootsector[512] = { data/nbdkit-1.22.3/tests/test-cxx-plugin.cpp:112:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char data[104857600]; data/nbdkit-1.22.3/tests/test-cxx-plugin.cpp:117: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, bootsector, sizeof bootsector); data/nbdkit-1.22.3/tests/test-cxx-plugin.cpp:137: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 (buf, data+offset, count); data/nbdkit-1.22.3/tests/test-delay.c:51: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 data[512]; data/nbdkit-1.22.3/tests/test-exit-with-parent.c:71:8: [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 (pidpath); data/nbdkit-1.22.3/tests/test-exit-with-parent.c:155:8: [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 (pidpath, "r"); data/nbdkit-1.22.3/tests/test-file-block.c:56: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 cmd[64], buf[64]; data/nbdkit-1.22.3/tests/test-file-block.c:79:8: [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 (disk); data/nbdkit-1.22.3/tests/test-file-block.c:209: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 cmd[64]; data/nbdkit-1.22.3/tests/test-layers.c:102: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 data[512]; data/nbdkit-1.22.3/tests/test-null.c:45: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 wdata[256]; data/nbdkit-1.22.3/tests/test-null.c:46: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 rdata[2048]; data/nbdkit-1.22.3/tests/test-offset.c:57: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 pattern[512]; data/nbdkit-1.22.3/tests/test-offset.c:65:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen (FILENAME, "w"); data/nbdkit-1.22.3/tests/test-offset.c:174: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 (FILENAME, O_RDONLY|O_CLOEXEC); data/nbdkit-1.22.3/tests/test-pause.c:70:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/nbdkit-1.22.3/tests/test-random.c:48: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 data[SIZE]; data/nbdkit-1.22.3/tests/test-random.c:57: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 rdata[RSIZE]; data/nbdkit-1.22.3/tests/test-random.c:66: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 sizearg[32]; data/nbdkit-1.22.3/tests/test-read-password-plugin.c:85:8: [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 (file, "w"); data/nbdkit-1.22.3/tests/test-socket-activation.c:103: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 pid_str[16]; data/nbdkit-1.22.3/tests/test-socket-activation.c:112: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 (sockpath, tmpdir, len); data/nbdkit-1.22.3/tests/test-socket-activation.c:113: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 (pidpath, tmpdir, len); data/nbdkit-1.22.3/tests/test-socket-activation.c:126: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 (addr.sun_path, sockpath, len+1 /* trailing \0 */); data/nbdkit-1.22.3/tests/test-split.c:45: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 data[8*512]; data/nbdkit-1.22.3/tests/test-stdio-plugin.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). dn = open ("/dev/null", O_RDONLY); data/nbdkit-1.22.3/tests/test-streaming.c:46: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 data[65536]; data/nbdkit-1.22.3/tests/test-streaming.c:55: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 md5[33]; data/nbdkit-1.22.3/tests/test-streaming.c:99:5: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). open ("streaming.fifo", O_RDONLY); data/nbdkit-1.22.3/tests/test.c:54: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 tmpdir[ 17 + 1]; /* template, NUL */ data/nbdkit-1.22.3/tests/test.c:55: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 sockpath[ 17 + 5 + 1]; /* template, "/sock", NUL */ data/nbdkit-1.22.3/tests/test.c:56: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 unixsockpath[5 + 17 + 5 + 1]; /* "unix:", template, "/sock", NUL */ data/nbdkit-1.22.3/tests/test.c:57: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 pidpath[ 17 + 4 + 1]; /* template, "/pid", NUL */ data/nbdkit-1.22.3/tests/test.c:72:7: [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 *server[2] = { NULL, NULL }; data/nbdkit-1.22.3/tests/test.c:144: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 (kit->sockpath, kit->tmpdir, len); data/nbdkit-1.22.3/tests/test.c:145: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 (kit->unixsockpath+5, kit->tmpdir, len); data/nbdkit-1.22.3/tests/test.c:146: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 (kit->pidpath, kit->tmpdir, len); data/nbdkit-1.22.3/tests/test.c:152: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 *argv[MAX_ARGS+1]; data/nbdkit-1.22.3/tests/test.h:43:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern const char *server[2]; /* server parameter for add_drive */ data/nbdkit-1.22.3/tests/web-server.c:65: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 request[16384]; data/nbdkit-1.22.3/tests/web-server.c:95: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 (filename, O_RDONLY|O_CLOEXEC); data/nbdkit-1.22.3/tests/web-server.c:112: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 (sockpath, tmpdir, strlen (tmpdir)); data/nbdkit-1.22.3/tests/web-server.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 (addr.sun_path, sockpath, strlen (sockpath) + 1); data/nbdkit-1.22.3/tests/web-server.c:249: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 response3[64]; data/nbdkit-1.22.3/wrapper.c:141: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 ts[32]; data/nbdkit-1.22.3/common/allocators/allocator.h:82:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int (*read) (struct allocator *a, void *buf, data/nbdkit-1.22.3/common/allocators/malloc.c:237:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return a1->f->read (a1, ma2->ba.ptr + offset2, count, offset1); data/nbdkit-1.22.3/common/allocators/sparse.c:446:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (a1->f->read (a1, p, n, offset1) == -1) data/nbdkit-1.22.3/common/allocators/zstd.c:536:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (a1->f->read (a1, p, n, offset1) == -1) data/nbdkit-1.22.3/common/include/get-current-dir-name.h:57:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return realloc (ret, strlen (ret) + 1); data/nbdkit-1.22.3/common/utils/environ.c:84:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (key); data/nbdkit-1.22.3/common/utils/quote.c:55:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (str); data/nbdkit-1.22.3/common/utils/quote.c:88:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (str); data/nbdkit-1.22.3/filters/cache/blk.c:106:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (tmpdir) + 8; data/nbdkit-1.22.3/filters/cow/blk.c:112:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (tmpdir) + 8; data/nbdkit-1.22.3/filters/delay/delay.c:56:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen (value); data/nbdkit-1.22.3/filters/ext2/io.c:168: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). &n) != 2 || n != strlen (name)) data/nbdkit-1.22.3/filters/ext2/io.c:195:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). retval = ext2fs_get_mem (strlen (name)+1, &io->name); data/nbdkit-1.22.3/filters/gzip/gzip.c:154:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (tmpdir) + 8; data/nbdkit-1.22.3/filters/ip/ip.c:146:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (addr, value, n); data/nbdkit-1.22.3/filters/ip/ip.c:175:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buf, value, n); data/nbdkit-1.22.3/filters/pause/pause.c:91:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (sockfile); data/nbdkit-1.22.3/filters/pause/pause.c:195:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((n = read (s, &c, 1)) == 1) { data/nbdkit-1.22.3/filters/tls-fallback/tls-fallback.c:56:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (message, value, sizeof message); /* Yes, we really mean strncpy */ data/nbdkit-1.22.3/plugins/curl/curl.c:168:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (curl_protocols[i].name) == n && data/nbdkit-1.22.3/plugins/curl/curl.c:541:42: [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 (ascii_strncasecmp (url, "http://", strlen ("http://")) == 0 || data/nbdkit-1.22.3/plugins/curl/curl.c:542:43: [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). ascii_strncasecmp (url, "https://", strlen ("https://")) == 0) { data/nbdkit-1.22.3/plugins/curl/curl.c:625: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). if (realsize >= strlen (accept_ranges) && data/nbdkit-1.22.3/plugins/curl/curl.c:626:49: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ascii_strncasecmp (header, accept_ranges, strlen (accept_ranges)) == 0) { data/nbdkit-1.22.3/plugins/curl/curl.c:633:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (end - p >= strlen (bytes) data/nbdkit-1.22.3/plugins/curl/curl.c:634:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). && strncmp (p, bytes, strlen (bytes)) == 0) { data/nbdkit-1.22.3/plugins/curl/curl.c:636: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 += strlen (bytes); data/nbdkit-1.22.3/plugins/data/data.c:85: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). in.size = strlen (value); data/nbdkit-1.22.3/plugins/data/data.c:172: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). data_size = strlen (data_param); data/nbdkit-1.22.3/plugins/data/data.c:279:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return a->f->read (a, buf, count, offset); data/nbdkit-1.22.3/plugins/data/format.c:429:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen (value); data/nbdkit-1.22.3/plugins/eval/call.c:286:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (pfds[1].fd, *rbuf + *rbuflen, rbufalloc - *rbuflen); data/nbdkit-1.22.3/plugins/eval/call.c:307:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (pfds[2].fd, *ebuf + *ebuflen, ebufalloc - *ebuflen); data/nbdkit-1.22.3/plugins/eval/eval.c:179:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (value); data/nbdkit-1.22.3/plugins/eval/eval.c:181:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (fwrite (value, strlen (value), 1, fp) != 1) { data/nbdkit-1.22.3/plugins/eval/methods.c:419: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 slen = strlen (str); data/nbdkit-1.22.3/plugins/eval/methods.c:424:5: [1] (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 character. strcpy (*buf, ","); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:222: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 (label); data/nbdkit-1.22.3/plugins/floppy/directory-lfn.c:459:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const size_t input_len = strlen (name); data/nbdkit-1.22.3/plugins/info/info.c:229:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ret->len = strlen (str); data/nbdkit-1.22.3/plugins/info/info.c:277: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). export_name_len = strlen (export_name); data/nbdkit-1.22.3/plugins/memory/memory.c:179:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return a->f->read (a, buf, count, offset); data/nbdkit-1.22.3/plugins/nbd/nbd.c:275:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (sockname) > sizeof sock.sun_path) { data/nbdkit-1.22.3/plugins/nbd/nbd.c:427:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (h->fds[0], buf, sizeof buf) == -1 && errno != EAGAIN) { data/nbdkit-1.22.3/plugins/ondemand/ondemand.c:324:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (h->exportname) > NAME_MAX || data/nbdkit-1.22.3/plugins/partitioning/partition-gpt.c:166:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (filename); data/nbdkit-1.22.3/plugins/partitioning/partition-gpt.c:230:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen (str); data/nbdkit-1.22.3/plugins/perl/perl.c:270:39: [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). XPUSHs (sv_2mortal (newSVpv (key, strlen (key)))); data/nbdkit-1.22.3/plugins/perl/perl.c:271:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). XPUSHs (sv_2mortal (newSVpv (value, strlen (value)))); data/nbdkit-1.22.3/plugins/sh/call.c:286:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (pfds[1].fd, *rbuf + *rbuflen, rbufalloc - *rbuflen); data/nbdkit-1.22.3/plugins/sh/call.c:307:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (pfds[2].fd, *ebuf + *ebuflen, ebufalloc - *ebuflen); data/nbdkit-1.22.3/plugins/sh/methods.c:419: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 slen = strlen (str); data/nbdkit-1.22.3/plugins/sh/methods.c:424:5: [1] (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 character. strcpy (*buf, ","); data/nbdkit-1.22.3/plugins/streaming/streaming.c:235:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (fd, discard, n); data/nbdkit-1.22.3/plugins/streaming/streaming.c:253:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (fd, buf, count); data/nbdkit-1.22.3/plugins/vddk/reexec.c:119:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (fd, buf.ptr + buf.size, buf.alloc - buf.size); data/nbdkit-1.22.3/plugins/vddk/reexec.c:132: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). for (len = 0; len < buf.size; len += strlen (buf.ptr + len) + 1) { data/nbdkit-1.22.3/plugins/vddk/reexec.c:168: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). if (write (fd, password, strlen (password)) != strlen (password)) { data/nbdkit-1.22.3/plugins/vddk/reexec.c:168:52: [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 (write (fd, password, strlen (password)) != strlen (password)) { data/nbdkit-1.22.3/plugins/vddk/reexec.c:244:42: [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). (libdir && strncmp (env, libdir, strlen (libdir)) != 0)) { data/nbdkit-1.22.3/plugins/vddk/vddk.c:130:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen (str); data/nbdkit-1.22.3/server/backend.c:95:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (name); data/nbdkit-1.22.3/server/connections.c:443:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (sock, buf, len); data/nbdkit-1.22.3/server/exports.c:118:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (name) > NBD_MAX_STRING || data/nbdkit-1.22.3/server/exports.c:119: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). (description && strlen (description) > NBD_MAX_STRING)) { data/nbdkit-1.22.3/server/fuzzer.c:172:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (sock, rbuf, sizeof rbuf); data/nbdkit-1.22.3/server/main.c:491:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (0022); data/nbdkit-1.22.3/server/main.c:953:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (pidstr); data/nbdkit-1.22.3/server/protocol-handshake-newstyle.c:96: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). size_t name_len = strlen (export.name); data/nbdkit-1.22.3/server/protocol-handshake-newstyle.c:97:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t desc_len = export.description ? strlen (export.description) : 0; data/nbdkit-1.22.3/server/protocol-handshake-newstyle.c:167: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 size_t namelen = strlen (name); data/nbdkit-1.22.3/server/protocol.c:307:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (sock, buf, count > BUFSIZ ? BUFSIZ : count); data/nbdkit-1.22.3/server/sockets.c:107:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (unixsocket); data/nbdkit-1.22.3/tests/test-file-block.c:104:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (buf); data/nbdkit-1.22.3/tests/test-file-block.c:159:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (guestfs_write (g, filename, content, strlen (content)) == -1) data/nbdkit-1.22.3/tests/test-golang.c:111:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (guestfs_write (g, filename, content, strlen (content)) == -1) data/nbdkit-1.22.3/tests/test-lang-plugins.c:100:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (guestfs_write (g, filename, content, strlen (content)) == -1) data/nbdkit-1.22.3/tests/test-layers.c:688:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (fd, &log_buf[log_len], allocated-log_len); data/nbdkit-1.22.3/tests/test-layers.c:728:38: [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 (memmem (log_buf, log_len, msg, strlen (msg)) == NULL) data/nbdkit-1.22.3/tests/test-layers.c:752:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). prev = memmem (log_buf, log_len, msg, strlen (msg)); data/nbdkit-1.22.3/tests/test-layers.c:758:48: [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). curr = memmem (log_buf, log_len, curr_msg, strlen (curr_msg)); data/nbdkit-1.22.3/tests/test-memory.c:86:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (guestfs_write (g, filename, content, strlen (content)) == -1) data/nbdkit-1.22.3/tests/test-ocaml.c:95:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (guestfs_write (g, filename, content, strlen (content)) == -1) data/nbdkit-1.22.3/tests/test-offset.c:148:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (guestfs_write (g, filename, content, strlen (content)) == -1) data/nbdkit-1.22.3/tests/test-pause.c:117:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (ctrlsock, &c, 1) != 1) { data/nbdkit-1.22.3/tests/test-pause.c:157:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (ctrlsock, &c, 1) != 1) { data/nbdkit-1.22.3/tests/test-socket-activation.c:111:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (tmpdir); data/nbdkit-1.22.3/tests/test-socket-activation.c:125:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (sockpath); data/nbdkit-1.22.3/tests/test-socket-activation.c:215:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (sock, &magic, sizeof magic) != sizeof magic) { data/nbdkit-1.22.3/tests/test-streaming.c:126:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (pipefd[0], md5, 32) != 32) { data/nbdkit-1.22.3/tests/test.c:143:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (kit->tmpdir); data/nbdkit-1.22.3/tests/web-server.c:112: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). memcpy (sockpath, tmpdir, strlen (tmpdir)); data/nbdkit-1.22.3/tests/web-server.c:120:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy (addr.sun_path, sockpath, strlen (sockpath) + 1); data/nbdkit-1.22.3/tests/web-server.c:194:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (s, &request[n], sz); data/nbdkit-1.22.3/tests/web-server.c:229:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). xwrite (s, response, strlen (response)); data/nbdkit-1.22.3/tests/web-server.c:260: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). xwrite (s, response1_ok, strlen (response1_ok)); data/nbdkit-1.22.3/tests/web-server.c:273:35: [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). xwrite (s, response1_partial, strlen (response1_partial)); data/nbdkit-1.22.3/tests/web-server.c:276:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). xwrite (s, response2, strlen (response2)); data/nbdkit-1.22.3/tests/web-server.c:279:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). xwrite (s, response3, strlen (response3)); data/nbdkit-1.22.3/tests/web-server.c:280:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). xwrite (s, response4, strlen (response4)); ANALYSIS SUMMARY: Hits = 530 Lines analyzed = 64637 in approximately 1.80 seconds (35979 lines/second) Physical Source Lines of Code (SLOC) = 42915 Hits@level = [0] 469 [1] 100 [2] 296 [3] 27 [4] 106 [5] 1 Hits@level+ = [0+] 999 [1+] 530 [2+] 430 [3+] 134 [4+] 107 [5+] 1 Hits/KSLOC@level+ = [0+] 23.2786 [1+] 12.35 [2+] 10.0198 [3+] 3.12245 [4+] 2.4933 [5+] 0.0233019 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.