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/casync-2+20190213/src/cacache.c Examining data/casync-2+20190213/src/cacache.h Examining data/casync-2+20190213/src/cachunk.c Examining data/casync-2+20190213/src/cachunk.h Examining data/casync-2+20190213/src/cachunker.c Examining data/casync-2+20190213/src/cachunker.h Examining data/casync-2+20190213/src/cachunkid.c Examining data/casync-2+20190213/src/cachunkid.h Examining data/casync-2+20190213/src/cacommon.h Examining data/casync-2+20190213/src/cacompression.c Examining data/casync-2+20190213/src/cacompression.h Examining data/casync-2+20190213/src/cadecoder.c Examining data/casync-2+20190213/src/cadecoder.h Examining data/casync-2+20190213/src/cadigest.c Examining data/casync-2+20190213/src/cadigest.h Examining data/casync-2+20190213/src/caencoder.c Examining data/casync-2+20190213/src/caencoder.h Examining data/casync-2+20190213/src/cafileroot.c Examining data/casync-2+20190213/src/cafileroot.h Examining data/casync-2+20190213/src/caformat-util.c Examining data/casync-2+20190213/src/caformat-util.h Examining data/casync-2+20190213/src/caformat.h Examining data/casync-2+20190213/src/cafuse.c Examining data/casync-2+20190213/src/cafuse.h Examining data/casync-2+20190213/src/caindex.c Examining data/casync-2+20190213/src/caindex.h Examining data/casync-2+20190213/src/calocation.c Examining data/casync-2+20190213/src/calocation.h Examining data/casync-2+20190213/src/camakebst.c Examining data/casync-2+20190213/src/camakebst.h Examining data/casync-2+20190213/src/camatch.c Examining data/casync-2+20190213/src/camatch.h Examining data/casync-2+20190213/src/canametable.c Examining data/casync-2+20190213/src/canametable.h Examining data/casync-2+20190213/src/canbd.c Examining data/casync-2+20190213/src/canbd.h Examining data/casync-2+20190213/src/caorigin.c Examining data/casync-2+20190213/src/caorigin.h Examining data/casync-2+20190213/src/caprotocol-util.c Examining data/casync-2+20190213/src/caprotocol-util.h Examining data/casync-2+20190213/src/caprotocol.h Examining data/casync-2+20190213/src/caremote.c Examining data/casync-2+20190213/src/caremote.h Examining data/casync-2+20190213/src/caseed.c Examining data/casync-2+20190213/src/caseed.h Examining data/casync-2+20190213/src/castore.c Examining data/casync-2+20190213/src/castore.h Examining data/casync-2+20190213/src/casync-http.c Examining data/casync-2+20190213/src/casync-tool.c Examining data/casync-2+20190213/src/casync.c Examining data/casync-2+20190213/src/casync.h Examining data/casync-2+20190213/src/cautil.c Examining data/casync-2+20190213/src/cautil.h Examining data/casync-2+20190213/src/chattr.c Examining data/casync-2+20190213/src/chattr.h Examining data/casync-2+20190213/src/compressor.c Examining data/casync-2+20190213/src/compressor.h Examining data/casync-2+20190213/src/copy.c Examining data/casync-2+20190213/src/def.h Examining data/casync-2+20190213/src/dirent-util.c Examining data/casync-2+20190213/src/dirent-util.h Examining data/casync-2+20190213/src/fssize.c Examining data/casync-2+20190213/src/fssize.h Examining data/casync-2+20190213/src/gc.c Examining data/casync-2+20190213/src/gc.h Examining data/casync-2+20190213/src/gcc-macro.h Examining data/casync-2+20190213/src/hash-funcs.c Examining data/casync-2+20190213/src/hash-funcs.h Examining data/casync-2+20190213/src/hashmap.c Examining data/casync-2+20190213/src/hashmap.h Examining data/casync-2+20190213/src/log.c Examining data/casync-2+20190213/src/log.h Examining data/casync-2+20190213/src/mempool.c Examining data/casync-2+20190213/src/mempool.h Examining data/casync-2+20190213/src/notify.c Examining data/casync-2+20190213/src/notify.h Examining data/casync-2+20190213/src/parse-util.c Examining data/casync-2+20190213/src/parse-util.h Examining data/casync-2+20190213/src/quota-projid.c Examining data/casync-2+20190213/src/quota-projid.h Examining data/casync-2+20190213/src/realloc-buffer.c Examining data/casync-2+20190213/src/realloc-buffer.h Examining data/casync-2+20190213/src/reflink.c Examining data/casync-2+20190213/src/reflink.h Examining data/casync-2+20190213/src/rm-rf.c Examining data/casync-2+20190213/src/rm-rf.h Examining data/casync-2+20190213/src/set.h Examining data/casync-2+20190213/src/signal-handler.c Examining data/casync-2+20190213/src/signal-handler.h Examining data/casync-2+20190213/src/siphash24.c Examining data/casync-2+20190213/src/siphash24.h Examining data/casync-2+20190213/src/time-util.c Examining data/casync-2+20190213/src/time-util.h Examining data/casync-2+20190213/src/udev-util.h Examining data/casync-2+20190213/src/util.c Examining data/casync-2+20190213/src/util.h Examining data/casync-2+20190213/test/fuzz/fuzz-compress.c Examining data/casync-2+20190213/test/fuzz/fuzz-main.c Examining data/casync-2+20190213/test/fuzz/fuzz.h Examining data/casync-2+20190213/test/notify-wait.c Examining data/casync-2+20190213/test/test-cachunk.c Examining data/casync-2+20190213/test/test-cachunker-histogram.c Examining data/casync-2+20190213/test/test-cachunker.c Examining data/casync-2+20190213/test/test-cadigest.c Examining data/casync-2+20190213/test/test-caencoder.c Examining data/casync-2+20190213/test/test-caformat.c Examining data/casync-2+20190213/test/test-caindex.c Examining data/casync-2+20190213/test/test-calc-digest.c Examining data/casync-2+20190213/test/test-calocation.c Examining data/casync-2+20190213/test/test-camakebst.c Examining data/casync-2+20190213/test/test-camatch.c Examining data/casync-2+20190213/test/test-caorigin.c Examining data/casync-2+20190213/test/test-casync.c Examining data/casync-2+20190213/test/test-cautil.c Examining data/casync-2+20190213/test/test-feature-flags.c Examining data/casync-2+20190213/test/test-util.c FINAL RESULTS: data/casync-2+20190213/src/cacache.c:348:17: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(p + CA_CHUNK_ID_SIZE*2+1, f); data/casync-2+20190213/src/cachunkid.c:110:17: [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(buffer + n + 4 + 1 + CA_CHUNK_ID_FORMAT_MAX - 1, suffix); data/casync-2+20190213/src/cadecoder.c:4576:17: [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(q, node->name); data/casync-2+20190213/src/caencoder.c:2387:9: [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(filename->name, de->d_name); data/casync-2+20190213/src/caencoder.c:2798:17: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(p, n->symlink_target); data/casync-2+20190213/src/caencoder.c:3066:17: [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(q, de->d_name); data/casync-2+20190213/src/caremote.c:1040:33: [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(args[0], args); data/casync-2+20190213/src/caremote.c:1042:33: [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(args[0], args); data/casync-2+20190213/src/caremote.c:2571:9: [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(a->reason, message); data/casync-2+20190213/src/casync-http.c:286:9: [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(mempcpy(mempcpy(mempcpy(mempcpy(mempcpy(buffer, store_url, n), "/", 1), ids, 4), "/", 1), ids, CA_CHUNK_ID_FORMAT_MAX-1), suffix); data/casync-2+20190213/src/casync-tool.c:1876:25: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(" size=%" PRIu64, size); data/casync-2+20190213/src/casync-tool.c:1888:25: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(" device=linux,%" PRIu32 ",%" PRIu32, data/casync-2+20190213/src/casync-tool.c:1893:25: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(" uid=" UID_FMT, uid); data/casync-2+20190213/src/casync-tool.c:1895:25: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(" gid=" GID_FMT, gid); data/casync-2+20190213/src/casync-tool.c:1953:25: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(" time=%" PRIu64 ".%09" PRIu64, data/casync-2+20190213/src/casync-tool.c:2033:33: [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. printf(UID_FMT "\n", uid); data/casync-2+20190213/src/casync-tool.c:2051:33: [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. printf(GID_FMT "\n", gid); data/casync-2+20190213/src/gcc-macro.h:6:47: [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. #define _printf_(a,b) __attribute__ ((format (printf, a, b))) data/casync-2+20190213/src/log.c:85: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. vfprintf(stderr, fmt, ap); data/casync-2+20190213/src/realloc-buffer.c:400:21: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. n = vsnprintf(p, m, fmt, ap); data/casync-2+20190213/test/notify-wait.c:146:17: [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(argv[1], argv + 1); data/casync-2+20190213/test/notify-wait.c:254:25: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(PID_FMT "\n", pid); data/casync-2+20190213/src/caremote.c:995:37: [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. e = getenv("CASYNC_PROTOCOL_PATH"); data/casync-2+20190213/src/caremote.c:1007:39: [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. ssh = getenv("CASYNC_SSH_PATH"); data/casync-2+20190213/src/caremote.c:1010:49: [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. remote_casync = getenv("CASYNC_REMOTE_PATH"); data/casync-2+20190213/src/casync-http.c:666:21: [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. while ((c = getopt_long(argc, argv, "hv", options, NULL)) >= 0) { data/casync-2+20190213/src/casync-tool.c:394:21: [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. while ((c = getopt_long(argc, argv, "hl:vnc", options, NULL)) >= 0) { data/casync-2+20190213/src/casync-tool.c:717:13: [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. e = getenv("CASYNC_STORE"); data/casync-2+20190213/src/cautil.c:252:13: [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. e = getenv("CASYNC_COMPRESSED_CHUNK_SUFFIX"); data/casync-2+20190213/src/log.c:40: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. e = getenv("CASYNC_LOG_LEVEL"); data/casync-2+20190213/src/notify.c:25:13: [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. e = getenv("NOTIFY_SOCKET"); data/casync-2+20190213/src/util.c:1158:13: [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. e = getenv(p); data/casync-2+20190213/test/fuzz/fuzz-compress.c:27: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. if (!getenv("CASYNC_LOG_LEVEL")) data/casync-2+20190213/test/test-cadigest.c:17:9: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(0); data/casync-2+20190213/src/cacache.c:132: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). c->fd = open(c->path, O_RDONLY|O_CLOEXEC|O_DIRECTORY); data/casync-2+20190213/src/cacache.c:148: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 path[CA_CHUNK_ID_PATH_SIZE(NULL, ".cachi")]; data/casync-2+20190213/src/cacache.c:192:17: [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(&chunk_id, realloc_buffer_data(&buffer), CA_CHUNK_ID_SIZE); data/casync-2+20190213/src/cacache.c:294: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 path[CA_CHUNK_ID_PATH_SIZE(NULL, ".cachi")]; data/casync-2+20190213/src/cacache.c:408: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 path[CA_CHUNK_ID_PATH_SIZE(NULL, ".cachi")]; data/casync-2+20190213/src/cachunk.c:448: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 path[CA_CHUNK_ID_PATH_SIZE(prefix, suffix)]; data/casync-2+20190213/src/cachunk.c:493: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 path[CA_CHUNK_ID_PATH_SIZE(prefix, suffix)]; data/casync-2+20190213/src/cachunk.c:509: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 path[CA_CHUNK_ID_PATH_SIZE(prefix, suffix)], *slash; data/casync-2+20190213/src/cachunk.c:531: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 old_path[CA_CHUNK_ID_PATH_SIZE(prefix, old_suffix)], new_path[CA_CHUNK_ID_PATH_SIZE(prefix, new_suffix)]; data/casync-2+20190213/src/cachunk.c:691: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 path[CA_CHUNK_ID_PATH_SIZE(prefix, NULL)]; data/casync-2+20190213/src/cachunker.c:238:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(c->window + c->window_size, q, m); data/casync-2+20190213/src/cachunkid.c:51: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* ca_chunk_id_format(const CaChunkID *id, char v[CA_CHUNK_ID_FORMAT_MAX]) { data/casync-2+20190213/src/cachunkid.c:84: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(ret, ca_digest_read(digest), sizeof(CaChunkID)); data/casync-2+20190213/src/cachunkid.c:101:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer, prefix, n); data/casync-2+20190213/src/cachunkid.c:106: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(buffer + n, buffer + n + 4 + 1, 4); data/casync-2+20190213/src/cachunkid.h:23: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 *ca_chunk_id_format(const CaChunkID *id, char v[CA_CHUNK_ID_FORMAT_MAX]); data/casync-2+20190213/src/cachunkid.h:23: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 *ca_chunk_id_format(const CaChunkID *id, char v[CA_CHUNK_ID_FORMAT_MAX]); data/casync-2+20190213/src/cadecoder.c:1887:25: [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(&u->format, x, l); data/casync-2+20190213/src/cadecoder.c:1957:25: [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(&a->user, u, l); data/casync-2+20190213/src/cadecoder.c:2021:25: [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(&a->group, u, l); data/casync-2+20190213/src/cadecoder.c:2766:17: [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(args.name, name, l); data/casync-2+20190213/src/cadecoder.c:3708: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. char proc_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1]; data/casync-2+20190213/src/cadecoder.c:3720:17: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc_path, "/proc/self/fd/%i", child->fd < 0 ? path_fd : child->fd); data/casync-2+20190213/src/cadecoder.c:5389: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(ret, q, sizeof(CaChunkID)); data/casync-2+20190213/src/cadecoder.c:5429: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(ret, q, sizeof(CaChunkID)); data/casync-2+20190213/src/cadecoder.c:5469: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(ret, q, sizeof(CaChunkID)); data/casync-2+20190213/src/cadigest.c:159:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char *const table[_CA_DIGEST_TYPE_MAX] = { data/casync-2+20190213/src/caencoder.c:1104:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(p, "re"); data/casync-2+20190213/src/caencoder.c:1545: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 proc_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1]; data/casync-2+20190213/src/caencoder.c:1598:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc_path, "/proc/self/fd/%i", n->fd < 0 ? path_fd : n->fd); data/casync-2+20190213/src/caencoder.c:2789:17: [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, &header, sizeof(header)); data/casync-2+20190213/src/caencoder.c:2808:17: [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, &device, sizeof(device)); data/casync-2+20190213/src/caencoder.c:3635: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. char name[l + 1]; data/casync-2+20190213/src/caencoder.c:3643:17: [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(name, path, l); data/casync-2+20190213/src/caencoder.c:3971: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(ret, q, sizeof(CaChunkID)); data/casync-2+20190213/src/caencoder.c:4008: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(ret, q, sizeof(CaChunkID)); data/casync-2+20190213/src/caencoder.c:4046: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(ret, q, sizeof(CaChunkID)); data/casync-2+20190213/src/cafuse.c:351:25: [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/casync-2+20190213/src/cafuse.c:529:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer, v, l); data/casync-2+20190213/src/caindex.c:236: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). i->fd = open(p, i->open_flags, 0666 & i->make_mode); data/casync-2+20190213/src/caindex.c:458: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(&item.chunk, id, sizeof(CaChunkID)); data/casync-2+20190213/src/caindex.c:578:17: [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_id, buffer.item.chunk, sizeof(CaChunkID)); data/casync-2+20190213/src/calocation.c:568: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). fd = open(p, O_CLOEXEC|O_RDONLY|O_NOCTTY|O_NOFOLLOW); data/casync-2+20190213/src/calocation.c:639: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(ret, ca_digest_read(digest), sizeof(CaChunkID)); data/casync-2+20190213/src/camakebst.c:48: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((uint8_t*) output + i * size, (const uint8_t*) input + k * size, size); data/casync-2+20190213/src/camatch.c:26:17: [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->name, name, l); data/casync-2+20190213/src/canametable.c:90:17: [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(nt->items, (*t)->items, om * sizeof(CaNameItem)); data/casync-2+20190213/src/canametable.c:324: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(buffer, t->items, m * sizeof(CaNameItem)); data/casync-2+20190213/src/canbd.c:167:31: [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). d->friendly_name_fd = open(t, O_CREAT|O_EXCL|O_RDWR|O_CLOEXEC, 0644); data/casync-2+20190213/src/canbd.c:208:31: [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). existing_fd = open(d->friendly_name_path, O_RDONLY|O_CLOEXEC|O_NOCTTY); data/casync-2+20190213/src/canbd.c:298:32: [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). d->device_fd = open(d->device_path, O_CLOEXEC|O_RDWR|O_NONBLOCK|O_NOCTTY); data/casync-2+20190213/src/canbd.c:330:40: [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). d->device_fd = open(path, O_CLOEXEC|O_RDWR|O_NONBLOCK|O_NOCTTY); data/casync-2+20190213/src/caremote.c:689: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). rr->cache_fd = open(rr->cache_path, O_RDONLY|O_CLOEXEC|O_DIRECTORY); data/casync-2+20190213/src/caremote.c:697: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 ids[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/src/caremote.c:893:25: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f->fd = open(f->path, flags); data/casync-2+20190213/src/caremote.c:906: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). f->fd = open(f->temporary_path, flags|O_CREAT|O_EXCL|O_NOFOLLOW, 0666); data/casync-2+20190213/src/caremote.c:1302: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(&rr->last_chunk, chunk->chunk, CA_CHUNK_ID_SIZE); data/casync-2+20190213/src/caremote.c:1903:17: [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, &id, CA_CHUNK_ID_SIZE); data/casync-2+20190213/src/caremote.c:2251: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(chunk->chunk, chunk_id, CA_CHUNK_ID_SIZE); data/casync-2+20190213/src/caremote.c:2252: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(chunk->data, data, size); data/casync-2+20190213/src/caremote.c:2283: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(missing->chunk, chunk_id, CA_CHUNK_ID_SIZE); data/casync-2+20190213/src/caremote.c:2339: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(p->data, data, size); data/casync-2+20190213/src/caremote.c:2704: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 ids[CA_CHUNK_ID_FORMAT_MAX], *qpos; data/casync-2+20190213/src/caseed.c:138: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). s->base_fd = open(path, O_CLOEXEC|O_NOCTTY|O_RDONLY); data/casync-2+20190213/src/caseed.c:223:31: [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). s->cache_fd = open(s->cache_path, O_RDONLY|O_CLOEXEC|O_DIRECTORY); data/casync-2+20190213/src/caseed.c:251: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 ids[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/src/caseed.c:407: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 v[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/src/caseed.c:543: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 id[CA_CHUNK_ID_FORMAT_MAX], *target = NULL; data/casync-2+20190213/src/caseed.c:658:25: [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((uint8_t*) p + n, q, m); data/casync-2+20190213/src/caseed.c:733: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 id[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/src/caseed.c:766: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 v[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/src/casync-http.c:268: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 ids[CA_CHUNK_ID_FORMAT_MAX], *buffer; data/casync-2+20190213/src/casync-tool.c:697: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. char buffer[DECIMAL_STR_MAX(int)]; data/casync-2+20190213/src/casync-tool.c:908: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 buffer[FORMAT_BYTES_MAX]; data/casync-2+20190213/src/casync-tool.c:996: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 buffer[FORMAT_BYTES_MAX]; data/casync-2+20190213/src/casync-tool.c:1264:28: [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). input_fd = open(input, O_CLOEXEC|O_RDONLY|O_NOCTTY); data/casync-2+20190213/src/casync-tool.c:1401:25: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char t[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/src/casync-tool.c:1555:29: [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). output_fd = open(output, O_CLOEXEC|O_WRONLY|O_NOCTTY); data/casync-2+20190213/src/casync-tool.c:1557:37: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). output_fd = open(output, O_CLOEXEC|O_RDONLY|O_NOCTTY|O_DIRECTORY); data/casync-2+20190213/src/casync-tool.c:1817: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. char ls_mode[LS_FORMAT_MODE_MAX]; data/casync-2+20190213/src/casync-tool.c:1964: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. char ls_mode[LS_FORMAT_MODE_MAX], ls_flags[LS_FORMAT_CHATTR_MAX], ls_fat_attrs[LS_FORMAT_FAT_ATTRS_MAX]; data/casync-2+20190213/src/casync-tool.c:2007:25: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char d[128]; data/casync-2+20190213/src/casync-tool.c:2172:36: [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). input_fd = open(input, O_CLOEXEC|O_RDONLY|O_NOCTTY); data/casync-2+20190213/src/casync-tool.c:2345:46: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char * const table[_CA_DIGEST_TYPE_MAX] = { data/casync-2+20190213/src/casync-tool.c:2351:33: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 v[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/src/casync-tool.c:2363:33: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 v[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/src/casync-tool.c:2489:36: [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). input_fd = open(input, O_CLOEXEC|O_RDONLY|O_NOCTTY); data/casync-2+20190213/src/casync-tool.c:2628:33: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 t[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/src/casync-tool.c:2680:33: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 t[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/src/casync-tool.c:3836: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 pretty[FILENAME_MAX+1]; data/casync-2+20190213/src/casync-tool.c:3853:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(p, O_RDONLY|O_CLOEXEC|O_NOCTTY); data/casync-2+20190213/src/casync.c:747:30: [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). s->base_fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_DIRECTORY); data/casync-2+20190213/src/casync.c:757:30: [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). s->base_fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY); data/casync-2+20190213/src/casync.c:855:26: [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). s->boundary_fd = open(p, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_DIRECTORY); data/casync-2+20190213/src/casync.c:909:25: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). s->archive_fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY); data/casync-2+20190213/src/casync.c:1300:33: [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). s->archive_fd = open(s->temporary_archive_path, O_WRONLY|O_CLOEXEC|O_NOCTTY|O_CREAT|O_EXCL, s->make_mode & 0666); data/casync-2+20190213/src/casync.c:1345:42: [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). s->boundary_fd = open(s->boundary_path, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_DIRECTORY); data/casync-2+20190213/src/casync.c:1360:46: [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). s->base_fd = open(s->base_path, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_DIRECTORY); data/casync-2+20190213/src/casync.c:1372:46: [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). s->base_fd = open(s->temporary_base_path, O_WRONLY|O_CLOEXEC|O_NOCTTY|O_CREAT|O_EXCL, 0666); data/casync-2+20190213/src/casync.c:1381:46: [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). s->base_fd = open(s->base_path, O_WRONLY|O_CLOEXEC|O_NOCTTY); data/casync-2+20190213/src/gc.c:106: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. char ids[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/src/hashmap.c:344: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(hash_key, current, sizeof(current)); data/casync-2+20190213/src/hashmap.c:444: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(e_to, e_from, hashmap_type_info[h->type].entry_size); data/casync-2+20190213/src/hashmap.c:1080:17: [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(new_storage, h->direct.storage, data/casync-2+20190213/src/realloc-buffer.c:60:17: [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, realloc_buffer_data(b), realloc_buffer_size(b)); data/casync-2+20190213/src/realloc-buffer.c:159: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(m, p, size); data/casync-2+20190213/src/reflink.c:18: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 path[sizeof("/proc/self/fd/") + DECIMAL_STR_MAX(fd)]; data/casync-2+20190213/src/reflink.c:28:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(path, "/proc/self/fd/%i", fd); data/casync-2+20190213/src/reflink.c:30:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd_read = open(path, O_CLOEXEC|O_RDONLY|O_NOCTTY); data/casync-2+20190213/src/util.c:393:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC|O_NOCTTY); data/casync-2+20190213/src/util.c:413:22: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 table[16] = "0123456789abcdef"; data/casync-2+20190213/src/util.c:631:32: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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* ls_format_mode(mode_t m, char ret[LS_FORMAT_MODE_MAX]) { data/casync-2+20190213/src/util.c:687: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 *ls_format_chattr(unsigned flags, char ret[LS_FORMAT_CHATTR_MAX]) { data/casync-2+20190213/src/util.c:687:40: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *ls_format_chattr(unsigned flags, char ret[LS_FORMAT_CHATTR_MAX]) { data/casync-2+20190213/src/util.c:720: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 *ls_format_fat_attrs(uint32_t flags, char ret[LS_FORMAT_FAT_ATTRS_MAX]) { data/casync-2+20190213/src/util.c:720:43: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *ls_format_fat_attrs(uint32_t flags, char ret[LS_FORMAT_FAT_ATTRS_MAX]) { data/casync-2+20190213/src/util.h:125: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(&u, p, sizeof(uint64_t)); data/casync-2+20190213/src/util.h:132: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(&u, p, sizeof(uint32_t)); data/casync-2+20190213/src/util.h:139: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(&u, p, sizeof(uint16_t)); data/casync-2+20190213/src/util.h:146: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(p, &u, sizeof(uint64_t)); data/casync-2+20190213/src/util.h:152: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(p, &u, sizeof(uint32_t)); data/casync-2+20190213/src/util.h:158: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(p, &u, sizeof(uint16_t)); data/casync-2+20190213/src/util.h:168: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(q, p, size); data/casync-2+20190213/src/util.h:216:33: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 _unused_ char _static_assert__macros_need_to_be_extended[20 - sizeof((int[]){__VA_ARGS__})/sizeof(int)]; \ data/casync-2+20190213/src/util.h:270:32: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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* ls_format_mode(mode_t m, char ret[LS_FORMAT_MODE_MAX]); data/casync-2+20190213/src/util.h:273: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 *ls_format_chattr(unsigned flags, char ret[LS_FORMAT_CHATTR_MAX]); data/casync-2+20190213/src/util.h:273:40: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *ls_format_chattr(unsigned flags, char ret[LS_FORMAT_CHATTR_MAX]); data/casync-2+20190213/src/util.h:276: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 *ls_format_fat_attrs(unsigned flags, char ret[LS_FORMAT_FAT_ATTRS_MAX]); data/casync-2+20190213/src/util.h:276:43: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *ls_format_fat_attrs(unsigned flags, char ret[LS_FORMAT_FAT_ATTRS_MAX]); data/casync-2+20190213/test/fuzz/fuzz-main.c:25: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. char buf[4096]; data/casync-2+20190213/test/fuzz/fuzz-main.c:28:51: [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). _cleanup_(safe_fclosep) FILE *f = fopen(name, "r"); data/casync-2+20190213/test/notify-wait.c:82: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(e + 1, sa.un.sun_path + 1, salen - offsetof(struct sockaddr_un, sun_path) - 1); data/casync-2+20190213/test/notify-wait.c:117:30: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). new_stdout = open("/dev/tty", O_WRONLY); data/casync-2+20190213/test/notify-wait.c:122:38: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). new_stdout = open("/dev/null", O_WRONLY); data/casync-2+20190213/test/test-cachunker-histogram.c:114:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/urandom", O_CLOEXEC|O_RDONLY); data/casync-2+20190213/test/test-cachunker.c:50:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/urandom", O_CLOEXEC|O_RDONLY|O_NOCTTY); data/casync-2+20190213/test/test-caencoder.c:234: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). dfd = open(argc > 1 ? argv[1] : ".", O_CLOEXEC|O_RDONLY|O_NOCTTY); data/casync-2+20190213/test/test-caencoder.c:255:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(t, O_RDONLY|O_CLOEXEC); data/casync-2+20190213/test/test-caformat.c:23:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(argv[1], O_RDONLY|O_CLOEXEC|O_NOCTTY); data/casync-2+20190213/test/test-caindex.c:24: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. char ids[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/test/test-calc-digest.c:47: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). fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY); data/casync-2+20190213/test/test-casync.c:17: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 t[CA_CHUNK_ID_FORMAT_MAX]; data/casync-2+20190213/test/test-casync.c:38:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). base_fd = open(".", O_RDONLY|O_CLOEXEC|O_DIRECTORY); data/casync-2+20190213/test/test-casync.c:74:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). base_fd = open(testtree, O_RDONLY|O_CLOEXEC|O_DIRECTORY); data/casync-2+20190213/src/cacache.c:203:59: [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 (!realloc_buffer_donate(&buffer, dest, strlen(dest)+1)) data/casync-2+20190213/src/cacache.c:344:57: [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 = newa(char, CA_CHUNK_ID_SIZE*2 + 1 + strlen(f) + 1); data/casync-2+20190213/src/cacache.c:392:56: [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 (!realloc_buffer_append(&buffer, f, strlen(f) + 1)) data/casync-2+20190213/src/cachunk.c:35:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). l = read(fd, p, BUFFER_SIZE); data/casync-2+20190213/src/cachunk.c:71:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). l = read(fd, fd_buffer + ccount, sizeof(fd_buffer) - ccount); data/casync-2+20190213/src/cachunk.c:120:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). l = read(fd, fd_buffer, sizeof(fd_buffer)); data/casync-2+20190213/src/cachunk.c:167:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). l = read(fd, fd_buffer, sizeof(fd_buffer)); data/casync-2+20190213/src/cachunkid.c:100:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(prefix); data/casync-2+20190213/src/cadecoder.c:1420: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). hash = siphash24(name, strlen(name), (const uint8_t[16]) CA_FORMAT_GOODBYE_HASH_KEY); data/casync-2+20190213/src/cadecoder.c:1486: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). n = strlen(component); data/casync-2+20190213/src/cadecoder.c:2762:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen(name); data/casync-2+20190213/src/cadecoder.c:2768:25: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). saved = umask(0077); data/casync-2+20190213/src/cadecoder.c:2770:17: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(saved); data/casync-2+20190213/src/cadecoder.c:3598:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen(child->symlink_target); data/casync-2+20190213/src/cadecoder.c:3708: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). char proc_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1]; data/casync-2+20190213/src/cadecoder.c:3804: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). z = strlen(q); data/casync-2+20190213/src/cadecoder.c:3831: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). k = strlen((char*) x->format.name_and_value); data/casync-2+20190213/src/cadecoder.c:4565:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). k = strlen(node->name); data/casync-2+20190213/src/caencoder.c:944:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). k = strlen(q); data/casync-2+20190213/src/caencoder.c:976:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). k = strlen(q); data/casync-2+20190213/src/caencoder.c:1545: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). char proc_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1]; data/casync-2+20190213/src/caencoder.c:2002: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). .hash = siphash24(name, strlen(name), (const uint8_t[16]) CA_FORMAT_GOODBYE_HASH_KEY), data/casync-2+20190213/src/caencoder.c:2376:51: [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 = offsetof(CaFormatFilename, name) + strlen(de->d_name) + 1; data/casync-2+20190213/src/caencoder.c:2432: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). (l[i].name ? strlen(l[i].name) + 1 : 0); data/casync-2+20190213/src/caencoder.c:2442: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). (l[i].name ? strlen(l[i].name) + 1 : 0); data/casync-2+20190213/src/caencoder.c:2461:54: [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). (l[i].name ? strlen(l[i].name) + 1 : 0)), data/casync-2+20190213/src/caencoder.c:2491:54: [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). (l[i].name ? strlen(l[i].name) + 1 : 0)), data/casync-2+20190213/src/caencoder.c:2624: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). strlen(e->cached_user_name) + 1; data/casync-2+20190213/src/caencoder.c:2627: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). strlen(e->cached_group_name) + 1; data/casync-2+20190213/src/caencoder.c:2632:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(n->xattrs[i].name) + 1 + data/casync-2+20190213/src/caencoder.c:2651:60: [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 += offsetof(CaFormatSELinux, label) + strlen(n->selinux_label) + 1; data/casync-2+20190213/src/caencoder.c:2663: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). strlen(n->symlink_target) + 1; data/casync-2+20190213/src/caencoder.c:2689:72: [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 = htole64(offsetof(CaFormatUser, name) + strlen(e->cached_user_name) + 1), data/casync-2+20190213/src/caencoder.c:2699:73: [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 = htole64(offsetof(CaFormatGroup, name) + strlen(e->cached_group_name) + 1), data/casync-2+20190213/src/caencoder.c:2711: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). strlen(n->xattrs[i].name) + 1 + data/casync-2+20190213/src/caencoder.c:2756:76: [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 = htole64(offsetof(CaFormatSELinux, label) + strlen(n->selinux_label) + 1), data/casync-2+20190213/src/caencoder.c:2794:77: [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 = htole64(offsetof(CaFormatSymlink, target) + strlen(n->symlink_target) + 1), data/casync-2+20190213/src/caencoder.c:3055:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). k = strlen(de->d_name); data/casync-2+20190213/src/cafuse.c:179:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ret, target, size); data/casync-2+20190213/src/cafuse.c:559: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). k += strlen(n) + 1; data/casync-2+20190213/src/caindex.c:551:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(i->fd, &final_byte, sizeof(final_byte)); data/casync-2+20190213/src/calocation.c:620:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ca_digest_write(digest, l->path, strlen(l->path)); data/casync-2+20190213/src/canbd.c:111:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(name) > sizeof(struct sockaddr_un) - offsetof(struct sockaddr_un, sun_path)) data/casync-2+20190213/src/canbd.c:184: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). l = strlen(d->friendly_name); data/casync-2+20190213/src/canbd.c:429:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). l = read(d->socket_fd[0], &d->last_request, sizeof(d->last_request)); data/casync-2+20190213/src/caremote.c:1005: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). skip = strlen(rr->url_prefix); data/casync-2+20190213/src/caremote.c:1107:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(rr->input_fd, p, left); data/casync-2+20190213/src/caremote.c:1786:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(f->fd, (uint8_t*) p + offsetof(CaProtocolFile, data), BUFFER_SIZE); data/casync-2+20190213/src/caremote.c:2561: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). l = strlen(message); data/casync-2+20190213/src/caseed.c:301:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). k = strlen(t); data/casync-2+20190213/src/casync-http.c:61:25: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(sleep_usec); data/casync-2+20190213/src/casync-http.c:280:71: [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). buffer = new(char, n + 1 + 4 + 1 + CA_CHUNK_ID_FORMAT_MAX-1 + strlen(suffix) + 1); data/casync-2+20190213/src/casync-tool.c:1762:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen(p); data/casync-2+20190213/src/casync-tool.c:3874:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, pretty, sizeof(pretty)); data/casync-2+20190213/src/casync.c:2406:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(s->archive_fd, p, BUFFER_SIZE); data/casync-2+20190213/src/cautil.c:142: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). result = new(char, strlen(e) + 1); data/casync-2+20190213/src/cautil.c:178:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(suffix); data/casync-2+20190213/src/cautil.c:223:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(s) > 255) data/casync-2+20190213/src/copy.c:131:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fdf, buf, sizeof(buf)); data/casync-2+20190213/src/gc.c:157:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ids, chunk, dot - chunk); data/casync-2+20190213/src/hash-funcs.c:24: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). siphash24_compress(p, strlen(p) + 1, state); data/casync-2+20190213/src/notify.c:29: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). c = strlen(e); data/casync-2+20190213/src/notify.c:41:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sa.un.sun_path + 1, e + 1, sizeof(sa.un.sun_path) - 1); data/casync-2+20190213/src/notify.c:43:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sa.un.sun_path, e, sizeof(sa.un.sun_path)); data/casync-2+20190213/src/notify.c:45: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). n = sendto(fd, text, strlen(text), MSG_NOSIGNAL, &sa.sa, SOCKADDR_UN_LEN(sa.un)); data/casync-2+20190213/src/parse-util.c:99: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). p = e + strlen(table[i].suffix); data/casync-2+20190213/src/realloc-buffer.c:247:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). l = read(fd, p, add); data/casync-2+20190213/src/time-util.c:31:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(p, "infinity", l-1); data/casync-2+20190213/src/time-util.c:37:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(p, "0", l-1); data/casync-2+20190213/src/util.c:258:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(fd, p, l); data/casync-2+20190213/src/util.c:290:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). l = read(fd, m, MIN(bytes, buffer_size)); data/casync-2+20190213/src/util.c:308: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). a = strlen(p); data/casync-2+20190213/src/util.c:309: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). b = strlen(suffix); data/casync-2+20190213/src/util.c:489: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). t = new(char, strlen(p) + 2 + 16 + 1); data/casync-2+20190213/src/util.c:582:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen(x); data/casync-2+20190213/src/util.c:592: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). n = strlen(t); data/casync-2+20190213/src/util.c:1013: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). l = f = *x ? strlen(*x) : 0; data/casync-2+20190213/src/util.c:1024:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(t); data/casync-2+20190213/src/util.c:1231:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). k = read(fd, p, m); data/casync-2+20190213/src/util.c:1437:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(p)+1 > PATH_MAX) data/casync-2+20190213/src/util.h:306:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). _len_ += strlen(_appendees_[_i_]); \ data/casync-2+20190213/src/util.h:439: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). l = strlen(prefix); data/casync-2+20190213/src/util.h:513: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). return strlen(s); data/casync-2+20190213/test/notify-wait.c:37:53: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t buffer_size = 0, allocate_at_least = strlen("READY=1\n"); data/casync-2+20190213/test/notify-wait.c:240:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((size_t) n < strlen("READY=1")) data/casync-2+20190213/test/notify-wait.c:245:60: [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 = memmem(buffer, n, "\nREADY=1", strlen("\nREADY=1")); data/casync-2+20190213/test/notify-wait.c:249:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). p += strlen("\nREADY=1"); data/casync-2+20190213/test/test-cachunker-histogram.c:37:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). l = read(t->random_fd, buffer, sizeof(buffer)); data/casync-2+20190213/test/test-cachunker.c:57:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert_se(read(fd, buffer, sizeof(buffer)) == sizeof(buffer)); data/casync-2+20190213/test/test-caencoder.c:176:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, buffer, sizeof(buffer)); data/casync-2+20190213/test/test-calc-digest.c:59:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, buffer, sizeof(buffer)); ANALYSIS SUMMARY: Hits = 269 Lines analyzed = 43086 in approximately 0.92 seconds (46938 lines/second) Physical Source Lines of Code (SLOC) = 31276 Hits@level = [0] 96 [1] 91 [2] 144 [3] 12 [4] 22 [5] 0 Hits@level+ = [0+] 365 [1+] 269 [2+] 178 [3+] 34 [4+] 22 [5+] 0 Hits/KSLOC@level+ = [0+] 11.6703 [1+] 8.60084 [2+] 5.69126 [3+] 1.0871 [4+] 0.703415 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.