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/dhcpcd5-7.1.0/compat/_strtoi.h Examining data/dhcpcd5-7.1.0/compat/arc4random.c Examining data/dhcpcd5-7.1.0/compat/arc4random.h Examining data/dhcpcd5-7.1.0/compat/arc4random_uniform.c Examining data/dhcpcd5-7.1.0/compat/arc4random_uniform.h Examining data/dhcpcd5-7.1.0/compat/bitops.h Examining data/dhcpcd5-7.1.0/compat/crypt/hmac.c Examining data/dhcpcd5-7.1.0/compat/crypt/hmac.h Examining data/dhcpcd5-7.1.0/compat/crypt/md5.c Examining data/dhcpcd5-7.1.0/compat/crypt/md5.h Examining data/dhcpcd5-7.1.0/compat/crypt/sha256.c Examining data/dhcpcd5-7.1.0/compat/crypt/sha256.h Examining data/dhcpcd5-7.1.0/compat/dprintf.c Examining data/dhcpcd5-7.1.0/compat/dprintf.h Examining data/dhcpcd5-7.1.0/compat/endian.h Examining data/dhcpcd5-7.1.0/compat/pidfile.c Examining data/dhcpcd5-7.1.0/compat/pidfile.h Examining data/dhcpcd5-7.1.0/compat/queue.h Examining data/dhcpcd5-7.1.0/compat/reallocarray.c Examining data/dhcpcd5-7.1.0/compat/reallocarray.h Examining data/dhcpcd5-7.1.0/compat/strlcpy.c Examining data/dhcpcd5-7.1.0/compat/strlcpy.h Examining data/dhcpcd5-7.1.0/compat/strtoi.c Examining data/dhcpcd5-7.1.0/compat/strtoi.h Examining data/dhcpcd5-7.1.0/compat/strtou.c Examining data/dhcpcd5-7.1.0/compat/consttime_memequal.h Examining data/dhcpcd5-7.1.0/src/arp.c Examining data/dhcpcd5-7.1.0/src/arp.h Examining data/dhcpcd5-7.1.0/src/auth.h Examining data/dhcpcd5-7.1.0/src/bpf.c Examining data/dhcpcd5-7.1.0/src/bpf.h Examining data/dhcpcd5-7.1.0/src/common.c Examining data/dhcpcd5-7.1.0/src/common.h Examining data/dhcpcd5-7.1.0/src/control.c Examining data/dhcpcd5-7.1.0/src/control.h Examining data/dhcpcd5-7.1.0/src/defs.h Examining data/dhcpcd5-7.1.0/src/dev.c Examining data/dhcpcd5-7.1.0/src/dev.h Examining data/dhcpcd5-7.1.0/src/dev/udev.c Examining data/dhcpcd5-7.1.0/src/dhcp-common.c Examining data/dhcpcd5-7.1.0/src/dhcp-common.h Examining data/dhcpcd5-7.1.0/src/dhcp.h Examining data/dhcpcd5-7.1.0/src/dhcp6.h Examining data/dhcpcd5-7.1.0/src/dhcpcd.c Examining data/dhcpcd5-7.1.0/src/dhcpcd.h Examining data/dhcpcd5-7.1.0/src/duid.c Examining data/dhcpcd5-7.1.0/src/duid.h Examining data/dhcpcd5-7.1.0/src/eloop.c Examining data/dhcpcd5-7.1.0/src/eloop.h Examining data/dhcpcd5-7.1.0/src/if-bsd.c Examining data/dhcpcd5-7.1.0/src/if-linux-wext.c Examining data/dhcpcd5-7.1.0/src/if-linux.c Examining data/dhcpcd5-7.1.0/src/if-options.c Examining data/dhcpcd5-7.1.0/src/if-options.h Examining data/dhcpcd5-7.1.0/src/if-sun.c Examining data/dhcpcd5-7.1.0/src/if.c Examining data/dhcpcd5-7.1.0/src/if.h Examining data/dhcpcd5-7.1.0/src/ipv4.c Examining data/dhcpcd5-7.1.0/src/ipv4.h Examining data/dhcpcd5-7.1.0/src/ipv4ll.c Examining data/dhcpcd5-7.1.0/src/ipv4ll.h Examining data/dhcpcd5-7.1.0/src/ipv6.c Examining data/dhcpcd5-7.1.0/src/ipv6.h Examining data/dhcpcd5-7.1.0/src/ipv6nd.c Examining data/dhcpcd5-7.1.0/src/ipv6nd.h Examining data/dhcpcd5-7.1.0/src/logerr.c Examining data/dhcpcd5-7.1.0/src/logerr.h Examining data/dhcpcd5-7.1.0/src/route.c Examining data/dhcpcd5-7.1.0/src/route.h Examining data/dhcpcd5-7.1.0/src/sa.c Examining data/dhcpcd5-7.1.0/src/sa.h Examining data/dhcpcd5-7.1.0/src/script.c Examining data/dhcpcd5-7.1.0/src/script.h Examining data/dhcpcd5-7.1.0/src/dhcp.c Examining data/dhcpcd5-7.1.0/src/auth.c Examining data/dhcpcd5-7.1.0/src/dhcp6.c Examining data/dhcpcd5-7.1.0/tests/crypt/run-test.c Examining data/dhcpcd5-7.1.0/tests/crypt/test.h Examining data/dhcpcd5-7.1.0/tests/crypt/test_hmac_md5.c Examining data/dhcpcd5-7.1.0/tests/eloop-bench/eloop-bench.c FINAL RESULTS: data/dhcpcd5-7.1.0/src/control.c:240:6: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(sa.sun_path, fmode) == -1 || data/dhcpcd5-7.1.0/src/control.c:242:6: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(sa.sun_path, geteuid(), ctx->control_group) == -1) || data/dhcpcd5-7.1.0/src/ipv6.c:197:6: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(SECRET, S_IRUSR) == -1) data/dhcpcd5-7.1.0/src/logerr.c:81:6: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. if (readlink("/proc/self/exe", _logprog, PATH_MAX + 1) == -1) data/dhcpcd5-7.1.0/compat/dprintf.c:49:6: [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. e = vfprintf(fp, fmt, va); data/dhcpcd5-7.1.0/compat/dprintf.h:35:52: [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 __printflike(a, b) __attribute__((format(printf, a, b))) data/dhcpcd5-7.1.0/src/auth.c:429:7: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (fscanf(fp, "0x%016" PRIu64, &rdm) != 1) data/dhcpcd5-7.1.0/src/control.c:219: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(sa->sun_path, sizeof(sa->sun_path), CONTROLSOCKET, data/dhcpcd5-7.1.0/src/dev.c:93:2: [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(file, sizeof(file), DEVDIR "/%s", name); data/dhcpcd5-7.1.0/src/dhcp-common.c:857:9: [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. return snprintf(leasefile, len, data/dhcpcd5-7.1.0/src/dhcpcd.c:1716:4: [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(ctx.pidfile, sizeof(ctx.pidfile), data/dhcpcd5-7.1.0/src/dhcpcd.c:1719:4: [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(ctx.pidfile, sizeof(ctx.pidfile), data/dhcpcd5-7.1.0/src/if-linux.c:230:2: [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(path, sizeof(path), PROC_PROMOTE, ifp->name); data/dhcpcd5-7.1.0/src/if-linux.c:246:2: [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(path, sizeof(path), SYS_LAYER2, ifp->name); data/dhcpcd5-7.1.0/src/logerr.c:153:2: [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(stream, fmt, a); data/dhcpcd5-7.1.0/src/logerr.c:219:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buf, sizeof(buf), fmt, args); data/dhcpcd5-7.1.0/src/logerr.h:35:50: [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 __printflike(a, b) __attribute__((format(printf, a, b))) data/dhcpcd5-7.1.0/src/dhcpcd.c:1419:16: [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 ((opt = getopt_long(argc, argv, IF_OPTS, cf_options, &oi)) != -1) data/dhcpcd5-7.1.0/src/dhcpcd.c:1556:16: [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 ((opt = getopt_long(argc, argv, data/dhcpcd5-7.1.0/src/if-options.c:2580:16: [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 ((opt = getopt_long(argc, argv, data/dhcpcd5-7.1.0/src/ipv4ll.c:65:2: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. setstate(istate->randomstate); data/dhcpcd5-7.1.0/src/ipv4ll.c:74:7: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. r = random(); data/dhcpcd5-7.1.0/src/ipv4ll.c:85:2: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. setstate(istate->arp->iface->ctx->randomstate); data/dhcpcd5-7.1.0/src/ipv4ll.c:380:3: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. setstate(ifp->ctx->randomstate); data/dhcpcd5-7.1.0/src/script.c:719: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. svcname = getenv(RC_SVCNAME); data/dhcpcd5-7.1.0/src/script.c:727: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. path = getenv("PATH"); data/dhcpcd5-7.1.0/tests/eloop-bench/eloop-bench.c:124:14: [3] (buffer) getopt: 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(argc, argv, "a:n:r:w:")) != -1) { data/dhcpcd5-7.1.0/compat/arc4random.c:115:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/urandom", O_RDONLY); data/dhcpcd5-7.1.0/compat/crypt/hmac.c:174: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, digest, dlen); data/dhcpcd5-7.1.0/compat/crypt/hmac.c:188: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(digest, p, dlen); data/dhcpcd5-7.1.0/compat/crypt/md5.c:193:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ctx->buffer + have, input, need); data/dhcpcd5-7.1.0/compat/crypt/md5.c:210: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(ctx->buffer + have, input, len); data/dhcpcd5-7.1.0/compat/crypt/md5.c:218:19: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. MD5Final(unsigned char digest[MD5_DIGEST_LENGTH], MD5_CTX *ctx) data/dhcpcd5-7.1.0/compat/crypt/md5.h:27:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[MD5_BLOCK_LENGTH]; /* input buffer */ data/dhcpcd5-7.1.0/compat/crypt/sha256.c:47:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void *)dst, (const void *)src, (size_t)len) data/dhcpcd5-7.1.0/compat/crypt/sha256.c:51:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void *)dst, (const void *)src, (size_t)len) data/dhcpcd5-7.1.0/compat/crypt/sha256.c:113:51: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. SHA256_Transform(uint32_t * state, const unsigned char block[64]) data/dhcpcd5-7.1.0/compat/crypt/sha256.c:126:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(S, state, 32); data/dhcpcd5-7.1.0/compat/crypt/sha256.c:199: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 PAD[64] = { data/dhcpcd5-7.1.0/compat/crypt/sha256.c:210:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char len[8]; data/dhcpcd5-7.1.0/compat/crypt/sha256.c:266: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(&ctx->buf[r], src, len); data/dhcpcd5-7.1.0/compat/crypt/sha256.c:271:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ctx->buf[r], src, 64 - r); data/dhcpcd5-7.1.0/compat/crypt/sha256.c:284:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ctx->buf, src, len); data/dhcpcd5-7.1.0/compat/crypt/sha256.c:292:23: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx) data/dhcpcd5-7.1.0/compat/crypt/sha256.h:39:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[64]; data/dhcpcd5-7.1.0/compat/pidfile.c:50: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 pidfile_path[PATH_MAX]; data/dhcpcd5-7.1.0/compat/pidfile.c:136:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dpath[PATH_MAX], buf[16], *eptr; data/dhcpcd5-7.1.0/compat/pidfile.c:149: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 ((fd = open(path, O_RDONLY | O_NONBLOCK)) == -1) data/dhcpcd5-7.1.0/compat/pidfile.c:177:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dpath[PATH_MAX]; data/dhcpcd5-7.1.0/compat/pidfile.c:207: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 ((fd = open(path, opts, 0644)) == -1) data/dhcpcd5-7.1.0/src/arp.c:91:28: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define APPEND(b, l) CHECK(memcpy, b, l) data/dhcpcd5-7.1.0/src/arp.c:162:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&arm.sha, hw_s, ar.ar_hln); data/dhcpcd5-7.1.0/src/arp.c:163:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&arm.sip.s_addr, hw_s + ar.ar_hln, ar.ar_pln); data/dhcpcd5-7.1.0/src/arp.c:164:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&arm.tha, hw_t, ar.ar_hln); data/dhcpcd5-7.1.0/src/arp.c:165:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&arm.tip.s_addr, hw_t + ar.ar_hln, ar.ar_pln); data/dhcpcd5-7.1.0/src/arp.c:442: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[HWADDR_LEN * 3]; data/dhcpcd5-7.1.0/src/arp.h:56:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char sha[HWADDR_LEN]; data/dhcpcd5-7.1.0/src/arp.h:58:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char tha[HWADDR_LEN]; data/dhcpcd5-7.1.0/src/auth.c:251: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(state->reconf->key, d, 16); data/dhcpcd5-7.1.0/src/auth.c:332:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(mm, m, mlen); data/dhcpcd5-7.1.0/src/auth.c:374: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(state->token->key, t->key, t->key_len); data/dhcpcd5-7.1.0/src/auth.c:384:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->token->realm, t->realm, data/dhcpcd5-7.1.0/src/auth.c:414:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(RDM_MONOFILE, "r+"); data/dhcpcd5-7.1.0/src/auth.c:418: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(RDM_MONOFILE, "w"); data/dhcpcd5-7.1.0/src/auth.c:616: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, &rdm, 8); data/dhcpcd5-7.1.0/src/auth.c:635: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, t->key, t->key_len); data/dhcpcd5-7.1.0/src/auth.c:653: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, t->realm, t->realm_len); data/dhcpcd5-7.1.0/src/auth.c:667: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, &secretid, sizeof(secretid)); data/dhcpcd5-7.1.0/src/auth.c:694: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, hmac_code, sizeof(hmac_code)); data/dhcpcd5-7.1.0/src/auth.c:703: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, &giaddr, sizeof(giaddr)); data/dhcpcd5-7.1.0/src/bpf.c:118:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(_PATH_BPF, O_RDWR | O_NONBLOCK data/dhcpcd5-7.1.0/src/bpf.c:124:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char device[32]; data/dhcpcd5-7.1.0/src/bpf.c:129: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(device, O_RDWR | O_NONBLOCK data/dhcpcd5-7.1.0/src/bpf.c:235: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, payload, (size_t)bytes); data/dhcpcd5-7.1.0/src/bpf.c:354:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mac32, hwaddr, maclen); data/dhcpcd5-7.1.0/src/bpf.c:361:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&mac16, hwaddr, maclen); data/dhcpcd5-7.1.0/src/bpf.c:454: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(bp, bpf_arp_ether, sizeof(bpf_arp_ether)); data/dhcpcd5-7.1.0/src/bpf.c:464:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(bp, bpf_arp_filter, sizeof(bpf_arp_filter)); data/dhcpcd5-7.1.0/src/bpf.c:623: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(bp, bpf_bootp_ether, sizeof(bpf_bootp_ether)); data/dhcpcd5-7.1.0/src/bpf.c:632:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(bp, bpf_bootp_filter, sizeof(bpf_bootp_filter)); data/dhcpcd5-7.1.0/src/common.c:81:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[32]; data/dhcpcd5-7.1.0/src/common.c:101:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[32]; data/dhcpcd5-7.1.0/src/common.c:137:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char c[3]; data/dhcpcd5-7.1.0/src/common.c:179:12: [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). if ((fp = fopen(path, "r")) == NULL) data/dhcpcd5-7.1.0/src/control.c:107:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1024], *e, *p, *argvp[255], **ap, *a; data/dhcpcd5-7.1.0/src/control.c:334:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1024]; data/dhcpcd5-7.1.0/src/control.c:349:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer + len, argv[i], l); data/dhcpcd5-7.1.0/src/dev.c:87:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char file[PATH_MAX]; data/dhcpcd5-7.1.0/src/dhcp-common.c:379:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, q, l); data/dhcpcd5-7.1.0/src/dhcp-common.c:631:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[INET6_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/dhcp-common.c:834:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ssid[1 + (IF_SSIDLEN * 4) + 1]; /* - prefix and NUL terminated. */ data/dhcpcd5-7.1.0/src/dhcp-common.h:81:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char bitflags[8]; data/dhcpcd5-7.1.0/src/dhcp.c:251: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(bp, op, ol); data/dhcpcd5-7.1.0/src/dhcp.c:265: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(bp, op, ol); data/dhcpcd5-7.1.0/src/dhcp.c:382:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&addr.s_addr, p, ocets); data/dhcpcd5-7.1.0/src/dhcp.c:391: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.s_addr, p, 4); data/dhcpcd5-7.1.0/src/dhcp.c:442:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&dest.s_addr, p, ocets); data/dhcpcd5-7.1.0/src/dhcp.c:449: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(&gateway.s_addr, p, 4); data/dhcpcd5-7.1.0/src/dhcp.c:545: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(s, p, len); data/dhcpcd5-7.1.0/src/dhcp.c:738:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &addr.s_addr, 4); data/dhcpcd5-7.1.0/src/dhcp.c:757:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hbuf[HOSTNAME_MAX_LEN + 1]; data/dhcpcd5-7.1.0/src/dhcp.c:797: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(&bootp->chaddr, &ifp->hwaddr, ifp->hwlen); data/dhcpcd5-7.1.0/src/dhcp.c:827:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &ul, sizeof(ul)); data/dhcpcd5-7.1.0/src/dhcp.c:841:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &(a)->s_addr, 4); \ data/dhcpcd5-7.1.0/src/dhcp.c:848: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, state->clientid, (size_t)state->clientid[0] + 1); data/dhcpcd5-7.1.0/src/dhcp.c:875:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, DAD, len); data/dhcpcd5-7.1.0/src/dhcp.c:910:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &sz, 2); data/dhcpcd5-7.1.0/src/dhcp.c:917:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, ifo->userclass, data/dhcpcd5-7.1.0/src/dhcp.c:925:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, ifo->vendorclassid, data/dhcpcd5-7.1.0/src/dhcp.c:933:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, ifo->mudurl, (size_t)ifo->mudurl[0] + 1); data/dhcpcd5-7.1.0/src/dhcp.c:943: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, &ul, 4); data/dhcpcd5-7.1.0/src/dhcp.c:991:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, hostname, len); data/dhcpcd5-7.1.0/src/dhcp.c:999:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, ifo->vendor, (size_t)ifo->vendor[0] + 1); data/dhcpcd5-7.1.0/src/dhcp.c:1021:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &ul, sizeof(ul)); data/dhcpcd5-7.1.0/src/dhcp.c:1035: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, vivco->data, vivco->len); data/dhcpcd5-7.1.0/src/dhcp.c:1146:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(state->leasefile, O_WRONLY | O_CREAT | O_TRUNC, 0644); data/dhcpcd5-7.1.0/src/dhcp.c:1175: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(state->leasefile, O_RDONLY); data/dhcpcd5-7.1.0/src/dhcp.c:1311:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cidr[4], safe[(BOOTP_FILE_LEN * 4) + 1]; data/dhcpcd5-7.1.0/src/dhcp.c:1671:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&udpp->bootp, data, length); data/dhcpcd5-7.1.0/src/dhcp.c:1743:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(CMSG_DATA(cm), &ipi, sizeof(ipi)); data/dhcpcd5-7.1.0/src/dhcp.c:2139: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[HWADDR_LEN * 3]; data/dhcpcd5-7.1.0/src/dhcp.c:2374:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &cookie, sizeof(cookie)); data/dhcpcd5-7.1.0/src/dhcp.c:2380: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, &mask->s_addr, sizeof(mask->s_addr)); data/dhcpcd5-7.1.0/src/dhcp.c:2770:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *a, sname[sizeof(bootp->sname) * 4]; data/dhcpcd5-7.1.0/src/dhcp.c:2905: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[sizeof(bootp->chaddr) * 3]; data/dhcpcd5-7.1.0/src/dhcp.c:3182: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(state->offer, bootp, bootp_len); data/dhcpcd5-7.1.0/src/dhcp.c:3259: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(state->offer, bootp, bootp_len); data/dhcpcd5-7.1.0/src/dhcp.c:3564:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[(sizeof(ifo->clientid) - 1) * 3]; data/dhcpcd5-7.1.0/src/dhcp.c:3595: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(state->clientid, ifo->clientid, data/dhcpcd5-7.1.0/src/dhcp.c:3604:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->clientid + 2, ifo->iaid, 4); data/dhcpcd5-7.1.0/src/dhcp.c:3605:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->clientid + 6, ifp->ctx->duid, data/dhcpcd5-7.1.0/src/dhcp.c:3614:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->clientid + 2, ifp->hwaddr, data/dhcpcd5-7.1.0/src/dhcp.c:3751: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(state->new, data/dhcpcd5-7.1.0/src/dhcp.h:222:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char leasefile[sizeof(LEASEFILE) + IF_NAMESIZE + (IF_SSIDLEN * 4)]; data/dhcpcd5-7.1.0/src/dhcp6.c:229: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, &unlen, sizeof(unlen)); data/dhcpcd5-7.1.0/src/dhcp6.c:231: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, up, ulen); data/dhcpcd5-7.1.0/src/dhcp6.c:237: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, &o, sizeof(o)); data/dhcpcd5-7.1.0/src/dhcp6.c:251:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char vendor[VENDORCLASSID_MAX_LEN]; data/dhcpcd5-7.1.0/src/dhcp6.c:282: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, &o, sizeof(o)); data/dhcpcd5-7.1.0/src/dhcp6.c:285: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, &pen, sizeof(pen)); data/dhcpcd5-7.1.0/src/dhcp6.c:294: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, &hvlen, sizeof(hvlen)); data/dhcpcd5-7.1.0/src/dhcp6.c:296: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, vivco->data, vivco->len); data/dhcpcd5-7.1.0/src/dhcp6.c:301:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &hvlen, sizeof(hvlen)); data/dhcpcd5-7.1.0/src/dhcp6.c:303:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, vendor, (size_t)vlen); data/dhcpcd5-7.1.0/src/dhcp6.c:435:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(opt, &sec, sizeof(sec)); data/dhcpcd5-7.1.0/src/dhcp6.c:510:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sabuf[INET6_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/dhcp6.c:630:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hbuf[HOSTNAME_MAX_LEN + 1]; data/dhcpcd5-7.1.0/src/dhcp6.c:878:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &o, sizeof(o)); \ data/dhcpcd5-7.1.0/src/dhcp6.c:884: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, (_data), (_len)); \ data/dhcpcd5-7.1.0/src/dhcp6.c:989: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(o_lenp, &ia_na_len, sizeof(ia_na_len)); data/dhcpcd5-7.1.0/src/dhcp6.c:1015:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(o_lenp, &o.len, sizeof(o.len)); data/dhcpcd5-7.1.0/src/dhcp6.c:1053:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &o.code, sizeof(o.code)); data/dhcpcd5-7.1.0/src/dhcp6.c:1070:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &o.code, sizeof(o.code)); data/dhcpcd5-7.1.0/src/dhcp6.c:1078: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, &o.code, sizeof(o.code)); data/dhcpcd5-7.1.0/src/dhcp6.c:1084:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(o_lenp, &o.len, sizeof(o.len)); data/dhcpcd5-7.1.0/src/dhcp6.c:1323: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(CMSG_DATA(cm), &pi, sizeof(pi)); data/dhcpcd5-7.1.0/src/dhcp6.c:1918:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[32], *sbuf; data/dhcpcd5-7.1.0/src/dhcp6.c:1956: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(sbuf, opt, mlen); data/dhcpcd5-7.1.0/src/dhcp6.c:2214:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[sizeof(iaid) * 3]; data/dhcpcd5-7.1.0/src/dhcp6.c:2265: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(&ia, p, nl); data/dhcpcd5-7.1.0/src/dhcp6.c:2446:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(state->leasefile, O_WRONLY | O_CREAT | O_TRUNC, 0644); data/dhcpcd5-7.1.0/src/dhcp6.c:2478: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(state->leasefile, O_RDONLY); data/dhcpcd5-7.1.0/src/dhcp6.c:2967:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&state->renew, o, ol); data/dhcpcd5-7.1.0/src/dhcp6.c:3437:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->recv, r, len); data/dhcpcd5-7.1.0/src/dhcp6.h:205:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char leasefile[sizeof(LEASEFILE6) + IF_NAMESIZE + (IF_SSIDLEN * 4) +3]; data/dhcpcd5-7.1.0/src/dhcpcd.c:336: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 ((fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { data/dhcpcd5-7.1.0/src/dhcpcd.c:509:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ifo->iaid, &vlanid, sizeof(vlanid)); data/dhcpcd5-7.1.0/src/dhcpcd.c:519: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(ifo->iaid, ifp->name, len); data/dhcpcd5-7.1.0/src/dhcpcd.c:542:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ifo->ia->iaid, ifo->iaid, sizeof(ifo->iaid)); data/dhcpcd5-7.1.0/src/dhcpcd.c:567:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pssid[PROFILE_LEN]; data/dhcpcd5-7.1.0/src/dhcpcd.c:758: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(ossid, ifp->ssid, ifp->ssid_len); data/dhcpcd5-7.1.0/src/dhcpcd.c:823:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[DUID_LEN * 3]; data/dhcpcd5-7.1.0/src/dhcpcd.c:1032:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(iff->hwaddr, ifp->hwaddr, iff->hwlen); data/dhcpcd5-7.1.0/src/dhcpcd.c:1142:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[sizeof(ifp->hwaddr) * 3]; data/dhcpcd5-7.1.0/src/dhcpcd.c:1163:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ifp->hwaddr, hwaddr, hwlen); data/dhcpcd5-7.1.0/src/dhcpcd.h:77:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/dhcpcd.h:82:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hwaddr[HWADDR_LEN]; data/dhcpcd5-7.1.0/src/dhcpcd.h:91:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char profile[PROFILE_LEN]; data/dhcpcd5-7.1.0/src/dhcpcd.h:120:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pidfile[sizeof(PIDFILE) + IF_NAMESIZE + 1]; data/dhcpcd5-7.1.0/src/dhcpcd.h:160:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char control_sock[sizeof(CONTROLSOCKET) + IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/dhcpcd.h:185:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char ctlbuf[IP6BUFLEN]; data/dhcpcd5-7.1.0/src/dhcpcd.h:189:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char sndbuf[CMSG_SPACE(sizeof(struct in6_pktinfo))]; data/dhcpcd5-7.1.0/src/dhcpcd.h:191:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ntopbuf[INET6_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/duid.c:82:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen("/sys/class/dmi/id/product_uuid", "r"); data/dhcpcd5-7.1.0/src/duid.c:106:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char uuid[UUID_LEN + 1]; data/dhcpcd5-7.1.0/src/duid.c:116:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(d, &type, sizeof(type)); data/dhcpcd5-7.1.0/src/duid.c:133:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &u16, 2); data/dhcpcd5-7.1.0/src/duid.c:136:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &u16, 2); data/dhcpcd5-7.1.0/src/duid.c:143: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, &u32, 4); data/dhcpcd5-7.1.0/src/duid.c:147:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, ifp->hwaddr, ifp->hwlen); data/dhcpcd5-7.1.0/src/duid.c:160:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[DUID_STRLEN]; data/dhcpcd5-7.1.0/src/duid.c:207: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). if (!(fp = fopen(DUID, "w"))) { data/dhcpcd5-7.1.0/src/if-bsd.c:241:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nwid[IEEE80211_NWID_LEN]; data/dhcpcd5-7.1.0/src/if-bsd.c:253:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ssid, nwid.i_nwid, nwid.i_len); data/dhcpcd5-7.1.0/src/if-bsd.c:270:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ssid, nwid, ireq.i_len); data/dhcpcd5-7.1.0/src/if-bsd.c:371: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 ifname[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/if-bsd.c:373: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(ifname, sdl->sdl_data, sdl->sdl_nlen); data/dhcpcd5-7.1.0/src/if-bsd.c:448:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, src, src->sa_len); data/dhcpcd5-7.1.0/src/if-bsd.c:467:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[sizeof(struct sockaddr_storage) * RTAX_MAX]; data/dhcpcd5-7.1.0/src/if-bsd.c:478: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(bp, (sa), (sa)->sa_len); \ data/dhcpcd5-7.1.0/src/if-bsd.c:757: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(&sin->sin6_addr.s6_addr[2], &scope, data/dhcpcd5-7.1.0/src/if-bsd.c:991:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&dest, &rt.rt_dest, rt.rt_dest.sa_len); data/dhcpcd5-7.1.0/src/if-bsd.c:993:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&sdl, &rt.rt_gateway, rt.rt_gateway.sa_len); data/dhcpcd5-7.1.0/src/if-bsd.c:1040: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(&sdl, rti_info[RTAX_IFA], rti_info[RTAX_IFA]->sa_len); data/dhcpcd5-7.1.0/src/if-bsd.c:1248:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char march[SYS_NMLN]; data/dhcpcd5-7.1.0/src/if-linux.c:164:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/dhcpcd5-7.1.0/src/if-linux.c:171:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen("/proc/cpuinfo", "r"); data/dhcpcd5-7.1.0/src/if-linux.c:194:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(path, "r"); data/dhcpcd5-7.1.0/src/if-linux.c:209:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(path, "w"); data/dhcpcd5-7.1.0/src/if-linux.c:220:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[sizeof(PROC_PROMOTE) + IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/if-linux.c:242:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[sizeof(SYS_LAYER2) + IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/if-linux.c:486:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char *)sa + sa_addroffset(sa), RTA_DATA(rta), data/dhcpcd5-7.1.0/src/if-linux.c:715:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ifn[IF_NAMESIZE + 1]; data/dhcpcd5-7.1.0/src/if-linux.c:884: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(RTA_DATA(rta), data, alen); data/dhcpcd5-7.1.0/src/if-linux.c:905:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(RTA_DATA(rta), &data, sizeof(data)); data/dhcpcd5-7.1.0/src/if-linux.c:926:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(RTA_DATA(subrta), &data, sizeof(data)); data/dhcpcd5-7.1.0/src/if-linux.c:956:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[64]; data/dhcpcd5-7.1.0/src/if-linux.c:975:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(NLA_DATA(nla), &data, sizeof(data)); data/dhcpcd5-7.1.0/src/if-linux.c:998:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(NLA_DATA(nla), data, sl); data/dhcpcd5-7.1.0/src/if-linux.c:1111:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ifp->ssid, ie + 2, ifp->ssid_len); data/dhcpcd5-7.1.0/src/if-linux.c:1179:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[64]; data/dhcpcd5-7.1.0/src/if-linux.c:1186:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[256]; data/dhcpcd5-7.1.0/src/if-linux.c:1262:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char metricsbuf[32]; data/dhcpcd5-7.1.0/src/if-linux.c:1399:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))]; data/dhcpcd5-7.1.0/src/if-linux.c:1420: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, state->buffer + fl, (size_t)bytes); data/dhcpcd5-7.1.0/src/if-linux.c:1573:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *p, ifaddress[33], address[33], name[IF_NAMESIZE + 1]; data/dhcpcd5-7.1.0/src/if-linux.c:1577:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(PROC_INET6, "r"); data/dhcpcd5-7.1.0/src/if-linux.c:1621:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[32]; data/dhcpcd5-7.1.0/src/if-linux.c:1684:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[256]; data/dhcpcd5-7.1.0/src/if-linux.c:1722:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[256]; data/dhcpcd5-7.1.0/src/if-linux.c:1735:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[256]; data/dhcpcd5-7.1.0/src/if-linux.c:1749:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[256]; data/dhcpcd5-7.1.0/src/if-linux.c:1763:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[256]; data/dhcpcd5-7.1.0/src/if-options.c:255: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(lst[i] + l + 1, p, lv); data/dhcpcd5-7.1.0/src/if-options.c:289:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char c[4], cmd; data/dhcpcd5-7.1.0/src/if-options.c:407: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(iaid, &narg, sizeof(narg)); data/dhcpcd5-7.1.0/src/if-options.c:910: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(ifo->vendor + ifo->vendor[0] + 3, data/dhcpcd5-7.1.0/src/if-options.c:1822:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ndop->bitflags, bp, dl); data/dhcpcd5-7.1.0/src/if-options.c:2365: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(EMBEDDED_CONFIG, "r"); data/dhcpcd5-7.1.0/src/if-options.c:2394:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, *e, ol); data/dhcpcd5-7.1.0/src/if-options.c:2459:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(ctx->cffile, "r"); data/dhcpcd5-7.1.0/src/if-options.h:132:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ifname[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/if-options.h:193:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hostname[HOSTNAME_MAX_LEN + 1]; /* We don't store the length */ data/dhcpcd5-7.1.0/src/if-sun.c:91:26: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define COPYSA(dst, src) memcpy((dst), (src), salen((src))) data/dhcpcd5-7.1.0/src/if-sun.c:249:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sdl->sdl_data, pa, pa_len); data/dhcpcd5-7.1.0/src/if-sun.c:380:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ifname[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/if-sun.c:382: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(ifname, sdl->sdl_data, sdl->sdl_nlen); data/dhcpcd5-7.1.0/src/if-sun.c:889: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). if ((mux_fd = open(udp_dev, O_RDWR)) == -1) data/dhcpcd5-7.1.0/src/if-sun.c:972:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[sizeof(struct sockaddr_storage) * RTAX_MAX]; data/dhcpcd5-7.1.0/src/if-sun.c:985: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(bp, (sa), l); \ data/dhcpcd5-7.1.0/src/if-sun.c:1067:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ifname[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/if-sun.c:1119:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ifname[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/if-sun.c:1173: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). if ((s = open("/dev/arp", O_RDWR)) == -1) data/dhcpcd5-7.1.0/src/if.c:515:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ifp->hwaddr, CLLADDR(sdl), ifp->hwlen); data/dhcpcd5-7.1.0/src/if.c:522: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(ifp->hwaddr, sll->sll_addr, ifp->hwlen); data/dhcpcd5-7.1.0/src/if.h:138:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ifname[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/if.h:139:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char devname[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/if.h:140:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char drvname[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/ipv4.c:294:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(rt, r, sizeof(*rt)); data/dhcpcd5-7.1.0/src/ipv4.c:387:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[INET_MAX_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/ipv4.c:402:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[INET_MAX_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/ipv4.c:550:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char alias[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/ipv4.c:819:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sbrdbuf[INET_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/ipv4.h:83:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char saddr[INET_ADDRSTRLEN + 3]; data/dhcpcd5-7.1.0/src/ipv4.h:85:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char alias[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/ipv4ll.c:367:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&seed, ifp->hwaddr, ifp->hwlen); data/dhcpcd5-7.1.0/src/ipv4ll.h:48:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char randomstate[128]; data/dhcpcd5-7.1.0/src/ipv6.c:163:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[1024]; data/dhcpcd5-7.1.0/src/ipv6.c:189: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, &r, sizeof(r)); data/dhcpcd5-7.1.0/src/ipv6.c:196:12: [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). if ((fp = fopen(SECRET, "w")) == NULL || data/dhcpcd5-7.1.0/src/ipv6.c:260:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[2048], *p, digest[SHA256_DIGEST_LENGTH]; data/dhcpcd5-7.1.0/src/ipv6.c:281: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, prefix, l); data/dhcpcd5-7.1.0/src/ipv6.c:283: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, netiface, netiface_len); data/dhcpcd5-7.1.0/src/ipv6.c:285: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, netid, netid_len); data/dhcpcd5-7.1.0/src/ipv6.c:290:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, &vlanid, sizeof(vlanid)); data/dhcpcd5-7.1.0/src/ipv6.c:293: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, dad_counter, sizeof(*dad_counter)); data/dhcpcd5-7.1.0/src/ipv6.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(p, secret, secret_len); data/dhcpcd5-7.1.0/src/ipv6.c:306: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, prefix, l); data/dhcpcd5-7.1.0/src/ipv6.c:310: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 + l, digest + (sizeof(digest) - len), len); data/dhcpcd5-7.1.0/src/ipv6.c:385:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(addr, prefix, sizeof(*prefix)); data/dhcpcd5-7.1.0/src/ipv6.c:403:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&prefix->s6_addr, &addr->s6_addr, (size_t)bytes); data/dhcpcd5-7.1.0/src/ipv6.c:419: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 unsigned char masks[NBBY] = data/dhcpcd5-7.1.0/src/ipv6.c:763: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(ia2, ia, sizeof(*ia2)); data/dhcpcd5-7.1.0/src/ipv6.c:783:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char alias[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/ipv6.c:1055:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dbuf[INET6_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/ipv6.c:1341: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(ap->addr.s6_addr, ap->prefix.s6_addr, 8); data/dhcpcd5-7.1.0/src/ipv6.c:1354: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(&ap->addr.s6_addr[8], ifp->hwaddr, 8); data/dhcpcd5-7.1.0/src/ipv6.c:1436:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[INET6_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/ipv6.c:1817: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(seed, &r, sizeof(r)); data/dhcpcd5-7.1.0/src/ipv6.c:1819: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(seed + sizeof(r), &r, sizeof(r)); data/dhcpcd5-7.1.0/src/ipv6.c:1821: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(seed, state->randomseed0, sizeof(state->randomseed0)); data/dhcpcd5-7.1.0/src/ipv6.c:1823:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(seed + sizeof(state->randomseed0), data/dhcpcd5-7.1.0/src/ipv6.c:1845:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(seed, digest + 8, 8); data/dhcpcd5-7.1.0/src/ipv6.c:1919:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&randid[1], state->randomid + sizeof(randid[1]), data/dhcpcd5-7.1.0/src/ipv6.h:156:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char saddr[INET6_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/ipv6.h:178:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char alias[IF_NAMESIZE]; data/dhcpcd5-7.1.0/src/ipv6nd.c:266: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(nd + 1, ifp->hwaddr, ifp->hwlen); data/dhcpcd5-7.1.0/src/ipv6nd.c:314:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(CMSG_DATA(cm), &pi, sizeof(pi)); data/dhcpcd5-7.1.0/src/ipv6nd.c:372:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(CMSG_DATA(cm), &pi, sizeof(pi)); data/dhcpcd5-7.1.0/src/ipv6nd.c:454:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(opt + 1, ifp->hwaddr, ifp->hwlen); data/dhcpcd5-7.1.0/src/ipv6nd.c:768:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[INET6_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/ipv6nd.c:979: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(rap->data, icp, len); data/dhcpcd5-7.1.0/src/ipv6nd.c:1328:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ndprefix[32], abuf[24]; data/dhcpcd5-7.1.0/src/ipv6nd.c:1580:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[INET6_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/ipv6nd.c:1691: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(&hoplimit, CMSG_DATA(cm), sizeof(int)); data/dhcpcd5-7.1.0/src/ipv6nd.h:41:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sfrom[INET6_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/logerr.c:100:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[32]; data/dhcpcd5-7.1.0/src/logerr.c:217:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/dhcpcd5-7.1.0/src/logerr.c:341:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((ctx->log_file = fopen(path, "a")) == NULL) data/dhcpcd5-7.1.0/src/route.c:74:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dest[INET_MAX_ADDRSTRLEN], gateway[INET_MAX_ADDRSTRLEN]; data/dhcpcd5-7.1.0/src/route.c:301: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(f, rt, sizeof(*f)); data/dhcpcd5-7.1.0/src/script.c:214: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, *ap, l); data/dhcpcd5-7.1.0/src/script.c:437:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(env[elen], pfx, pfx_len); data/dhcpcd5-7.1.0/src/script.c:688:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *argv[2]; data/dhcpcd5-7.1.0/tests/eloop-bench/eloop-bench.c:64:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[1]; data/dhcpcd5-7.1.0/tests/eloop-bench/eloop-bench.c:127:22: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). nactive = (size_t)atoi(optarg); data/dhcpcd5-7.1.0/tests/eloop-bench/eloop-bench.c:130:21: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). npipes = (size_t)atoi(optarg); data/dhcpcd5-7.1.0/tests/eloop-bench/eloop-bench.c:133:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). nruns = (size_t)atoi(optarg); data/dhcpcd5-7.1.0/tests/eloop-bench/eloop-bench.c:136:22: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). nwrites = (size_t)atoi(optarg); data/dhcpcd5-7.1.0/compat/arc4random.c:120:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (void)read(fd, rdat.rnd, sizeof(rdat.rnd)); data/dhcpcd5-7.1.0/compat/pidfile.c:151:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, buf, sizeof(buf) - 1); data/dhcpcd5-7.1.0/src/bpf.c:210:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes = read(fd, state->buffer, state->buffer_size); data/dhcpcd5-7.1.0/src/bpf.c:306:10: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. bool equal, uint8_t *hwaddr, size_t hwaddr_len) data/dhcpcd5-7.1.0/src/bpf.c:334:6: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (equal) { data/dhcpcd5-7.1.0/src/common.c:62:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(var) + strlen(value) + 3; data/dhcpcd5-7.1.0/src/common.c:62: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). size_t len = strlen(var) + strlen(value) + 3; data/dhcpcd5-7.1.0/src/common.c:65:10: [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(prefix) + 1; data/dhcpcd5-7.1.0/src/control.c:51:55: [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). (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) data/dhcpcd5-7.1.0/src/control.c:112:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes = read(fd->fd, buffer, sizeof(buffer) - 1); data/dhcpcd5-7.1.0/src/control.c:135:10: [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(p); data/dhcpcd5-7.1.0/src/control.c:344: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). l = strlen(argv[i]) + 1; data/dhcpcd5-7.1.0/src/dhcp-common.c:72: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). strncmp(buf, "localhost.", strlen("localhost.")) == 0) data/dhcpcd5-7.1.0/src/dhcp-common.c:639:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen(p); data/dhcpcd5-7.1.0/src/dhcp-common.c:641: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). l += 1 + strlen(ifname); data/dhcpcd5-7.1.0/src/dhcp-common.c:691: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). l = strlen(tmp); data/dhcpcd5-7.1.0/src/dhcp-common.c:881: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). e = strlen(opt->var) + 1; data/dhcpcd5-7.1.0/src/dhcp-common.c:885:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). e += strlen(prefix); data/dhcpcd5-7.1.0/src/dhcp-common.c:946: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). e = strlen(prefix) + strlen(opt->var) + 2 + data/dhcpcd5-7.1.0/src/dhcp-common.c:946: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). e = strlen(prefix) + strlen(opt->var) + 2 + data/dhcpcd5-7.1.0/src/dhcp-common.c:1088:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((len = read(fd, buf, sz)) == -1) { data/dhcpcd5-7.1.0/src/dhcp.c:871: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(DAD); data/dhcpcd5-7.1.0/src/dhcp.c:987:10: [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(hostname); data/dhcpcd5-7.1.0/src/dhcp.c:2781: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). al = strlen(a); data/dhcpcd5-7.1.0/src/dhcp.c:3435:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(ctx->udp_fd, buffer, sizeof(buffer)) == -1) { data/dhcpcd5-7.1.0/src/dhcp6.c:4034: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). i = strlen(prefix) + strlen("_dhcp6") + 1; data/dhcpcd5-7.1.0/src/dhcp6.c:4034: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). i = strlen(prefix) + strlen("_dhcp6") + 1; data/dhcpcd5-7.1.0/src/dhcp6.c:4111: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). i += strlen(ap->saddr) + 1; data/dhcpcd5-7.1.0/src/dhcp6.c:4115:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). i += strlen(prefix) + strlen("_delegated_dhcp6_prefix="); data/dhcpcd5-7.1.0/src/dhcp6.c:4115: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). i += strlen(prefix) + strlen("_delegated_dhcp6_prefix="); data/dhcpcd5-7.1.0/src/dhcpcd.c:347:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(sidpipe[0], &buf, 1) == -1) data/dhcpcd5-7.1.0/src/dhcpcd.c:517: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). len = (uint32_t)strlen(ifp->name); data/dhcpcd5-7.1.0/src/dhcpcd.c:1377: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). strlen(VERSION) + 1, 0); data/dhcpcd5-7.1.0/src/dhcpcd.c:1380: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). strlen(fd->ctx->cffile) + 1, 0); data/dhcpcd5-7.1.0/src/dhcpcd.c:1399:10: [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(argv[opt]) + 1; data/dhcpcd5-7.1.0/src/dhcpcd.c:1405: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). l = strlen(argv[opt]); data/dhcpcd5-7.1.0/src/dhcpcd.c:1700: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). if (ifname == NULL || strlen(ifname) > IF_NAMESIZE) { data/dhcpcd5-7.1.0/src/dhcpcd.c:1787: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). ctx.pidfile[strlen(ctx.pidfile) - 1] == '6') data/dhcpcd5-7.1.0/src/duid.c:89:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(uuid) + 1; data/dhcpcd5-7.1.0/src/if-linux.c:175:9: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. while (fscanf(fp, "%255s : ", buf) != EOF) { data/dhcpcd5-7.1.0/src/if-linux.c:176:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncmp(buf, mproc, strlen(mproc)) == 0 && data/dhcpcd5-7.1.0/src/if-linux.c:177:7: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. fscanf(fp, "%255s", buf) == 1) data/dhcpcd5-7.1.0/src/if-linux.c:988: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). sl = strlen(data) + 1; data/dhcpcd5-7.1.0/src/if-linux.c:1472: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). (unsigned short)(strlen(addr->iface->alias) + 1)); data/dhcpcd5-7.1.0/src/if-linux.c:1542: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). ia->iface->alias, (unsigned short)(strlen(ia->iface->alias) + 1)); data/dhcpcd5-7.1.0/src/if-linux.c:1590: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(address) != 32) { data/dhcpcd5-7.1.0/src/if-options.c:230:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen(match); data/dhcpcd5-7.1.0/src/if-options.c:245: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). l = strlen(lst[i]); data/dhcpcd5-7.1.0/src/if-options.c:246:10: [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). lv = strlen(p); data/dhcpcd5-7.1.0/src/if-options.c:294: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). l = strlen(str); data/dhcpcd5-7.1.0/src/if-options.c:532: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). if (strncmp(arg, "nd_", strlen("nd_")) == 0) { data/dhcpcd5-7.1.0/src/if-options.c:541: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 arg + strlen("nd_"); data/dhcpcd5-7.1.0/src/if-options.c:544: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). if (strncmp(arg, "dhcp6_", strlen("dhcp6_")) == 0) { data/dhcpcd5-7.1.0/src/if-options.c:553: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 arg + strlen("dhcp6_"); data/dhcpcd5-7.1.0/src/if-options.c:963:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). dl = strlen("skip_hooks=") + strlen(arg) + 1; data/dhcpcd5-7.1.0/src/if-options.c:963: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). dl = strlen("skip_hooks=") + strlen(arg) + 1; data/dhcpcd5-7.1.0/src/if-options.c:1063: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). if (strncmp(arg, "ip_address=", strlen("ip_address=")) == 0) { data/dhcpcd5-7.1.0/src/if-options.c:1072: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). strlen("subnet_mask=")) == 0) data/dhcpcd5-7.1.0/src/if-options.c:1077: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). strlen("broadcast_address=")) == 0) data/dhcpcd5-7.1.0/src/if-options.c:1081: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). } else if (strncmp(arg, "routes=", strlen("routes=")) == 0 || data/dhcpcd5-7.1.0/src/if-options.c:1083: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). strlen("static_routes=")) == 0 || data/dhcpcd5-7.1.0/src/if-options.c:1085: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). strlen("classless_static_routes=")) == 0 || data/dhcpcd5-7.1.0/src/if-options.c:1087: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). strlen("ms_classless_static_routes=")) == 0) data/dhcpcd5-7.1.0/src/if-options.c:1113: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). } else if (strncmp(arg, "routers=", strlen("routers=")) == 0) { data/dhcpcd5-7.1.0/src/if-options.c:1124: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). strlen("interface_mtu=")) == 0 || data/dhcpcd5-7.1.0/src/if-options.c:1125: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). strncmp(arg, "mtu=", strlen("mtu=")) == 0) data/dhcpcd5-7.1.0/src/if-options.c:1133: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). } else if (strncmp(arg, "ip6_address=", strlen("ip6_address=")) == 0) { data/dhcpcd5-7.1.0/src/if-options.c:1821: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). dl = strlen(bp); data/dhcpcd5-7.1.0/src/if-options.c:2380: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). ol = strlen(*e) + 1; data/dhcpcd5-7.1.0/src/if-options.c:2402: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). p = line + strlen(line) - 1; data/dhcpcd5-7.1.0/src/if-options.c:2479:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). p = line + strlen(line) - 1; data/dhcpcd5-7.1.0/src/if.c:630: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). ep = spec->drvname + strlen(spec->drvname) - 1; data/dhcpcd5-7.1.0/src/script.c:129:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(prefix) + strlen(var) + 2; data/dhcpcd5-7.1.0/src/script.c:129: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). len = strlen(prefix) + strlen(var) + 2; data/dhcpcd5-7.1.0/src/script.c:156: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). if (strncmp(ne[j], prefix, strlen(prefix)) == 0 && data/dhcpcd5-7.1.0/src/script.c:157:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ne[j][strlen(prefix)] == '_' && data/dhcpcd5-7.1.0/src/script.c:158: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). strncmp(ne[j] + strlen(prefix) + 1, data/dhcpcd5-7.1.0/src/script.c:207:10: [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(*ap++) + 1; data/dhcpcd5-7.1.0/src/script.c:213: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). l = strlen(*ap) + 1; data/dhcpcd5-7.1.0/src/script.c:287:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (reason[strlen(reason) - 1] == '6') data/dhcpcd5-7.1.0/src/script.c:320:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). e = strlen("interface") + strlen(ifp->name) + 2; data/dhcpcd5-7.1.0/src/script.c:320: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). e = strlen("interface") + strlen(ifp->name) + 2; data/dhcpcd5-7.1.0/src/script.c:323:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). e = strlen("reason") + strlen(reason) + 2; data/dhcpcd5-7.1.0/src/script.c:323: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). e = strlen("reason") + strlen(reason) + 2; data/dhcpcd5-7.1.0/src/script.c:343:10: [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 = e = strlen("interface_order="); data/dhcpcd5-7.1.0/src/script.c:345:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). e += strlen(ifp2->name) + 1; data/dhcpcd5-7.1.0/src/script.c:418: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). e = strlen("syslog_debug=true") + 1; data/dhcpcd5-7.1.0/src/script.c:423: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). e = strlen("profile=") + strlen(ifp->profile) + 1; data/dhcpcd5-7.1.0/src/script.c:423: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). e = strlen("profile=") + strlen(ifp->profile) + 1; data/dhcpcd5-7.1.0/src/script.c:432: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). pfx_len = strlen(pfx); data/dhcpcd5-7.1.0/src/script.c:729: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). e = strlen("PATH") + strlen(path) + 2; data/dhcpcd5-7.1.0/src/script.c:729: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). e = strlen("PATH") + strlen(path) + 2; data/dhcpcd5-7.1.0/src/script.c:744: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). e = strlen(RC_SVCNAME) + strlen(svcname) + 2; data/dhcpcd5-7.1.0/src/script.c:744: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). e = strlen(RC_SVCNAME) + strlen(svcname) + 2; data/dhcpcd5-7.1.0/tests/eloop-bench/eloop-bench.c:66:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(p->fd[0], buf, 1) != 1) { ANALYSIS SUMMARY: Hits = 414 Lines analyzed = 37582 in approximately 0.95 seconds (39635 lines/second) Physical Source Lines of Code (SLOC) = 29556 Hits@level = [0] 138 [1] 95 [2] 292 [3] 10 [4] 13 [5] 4 Hits@level+ = [0+] 552 [1+] 414 [2+] 319 [3+] 27 [4+] 17 [5+] 4 Hits/KSLOC@level+ = [0+] 18.6764 [1+] 14.0073 [2+] 10.7931 [3+] 0.91352 [4+] 0.575179 [5+] 0.135336 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.