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/opendmarc-1.4.0~beta1+dfsg/contrib/rddmarc/mysql_ip6.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/dmarc.h Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_dns.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_hash.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_internal.h Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_strl.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_strl.h Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_util.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_alignment.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_dmarc_fetch.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_dmarc_parse.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_dns_lookup.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_finddomain.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_parse_to_buf.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_spf.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_tld.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_xml_parse.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_tld.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c Examining data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/config.c Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/config.h Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.c Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.h Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.h Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcseal.c Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcseal.h Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-check.c Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-dstring.c Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-dstring.h Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/parse.c Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/parse.h Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/test.c Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/test.h Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/util.c Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/util.h Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.h Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-config.h Examining data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c Parsing failed to find end of parameter list; semicolon terminated it in (LOG_WARNING, "%s: %s: flock(LOCK_EX): %s", #else # ifdef F_LOCK if (lockf(fileno(f), F_LOCK, 0) != 0) { syslog(LOG_WARNING, "%s: %s: lockf(F_LOCK): %s", # endif #endif /* LOCK_EX */ Parsing failed to find end of parameter list; semicolon terminated it in (LOG_WARNING, "%s: %s: flock(LOCK_UN): %s", #else # ifdef F_LOCK if (lockf(fileno(f), F_ULOCK, 0) != 0) { syslog(LOG_WARNING, "%s: %s: lockf(F_ULOCK): %s", # endif #endif /* LOCK_EX */ FINAL RESULTS: data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-dstring.c:459:8: [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. len = vsnprintf((char *) dstr->ds_buf + dstr->ds_len, rem, fmt, ap); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-dstring.c:471:9: [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. len = vsnprintf((char *) dstr->ds_buf + dstr->ds_len, rem, data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:3374:10: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. out = popen(conf->conf_reportcmd, "w"); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:3447: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(replybuf, sizeof replybuf, data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:4276:26: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (conffile == NULL && access(DEFCONFFILE, R_OK) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_alignment.c:33:11: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. srcdir = getenv("srcdir"); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_xml_parse.c:24:11: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. srcdir = getenv("srcdir"); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:3445:32: [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. if (conf->conf_rejectfail && random() % 100 < pct) data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:3478:32: [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. if (conf->conf_rejectfail && random() % 100 < pct) data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:4186:2: [3] (random) srandom: 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. srandom(now); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:4198: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, args)) != -1) data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:4626:7: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if (chroot(chrootdir) != 0) data/opendmarc-1.4.0~beta1+dfsg/opendmarc/test.c:86:6: [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. v = getenv(evname); data/opendmarc-1.4.0~beta1+dfsg/contrib/rddmarc/mysql_ip6.c:40:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(message,"INET_6TOP() takes one 16-byte argument"); data/opendmarc-1.4.0~beta1+dfsg/contrib/rddmarc/mysql_ip6.c:82:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(message,"INET_PTO6() takes one string argument"); data/opendmarc-1.4.0~beta1+dfsg/contrib/rddmarc/mysql_ip6.c:94: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[256]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_dns.c:125: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[MAXDNSHOSTNAME]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_dns.c:126:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char namebuf[MAXDNSHOSTNAME + 1]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_dns.c:235:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(&header, answer_buf, sizeof header); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_hash.c:332: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(b->data, data, datalen); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_hash.c:390: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(n->data, data, datalen); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_internal.h:246: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 mailfrom_addr[512]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_internal.h:247: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 mailfrom_domain[256]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_internal.h:248: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 helo_domain[256]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_internal.h:258: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 * lines[MAX_SPF_RECURSION+2]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_internal.h:261: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 mailfrom_addr[512]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_internal.h:262: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 helo_domain[256]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_internal.h:263: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 mailfrom_domain[256]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_internal.h:264: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 validated_domain[256]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_internal.h:265: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 ip_address[32]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_internal.h:266:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char spf_record[BUFSIZ *2]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_internal.h:269: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 exp_buf[512]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:49:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(&Opendmarc_Lib, lib_init, sizeof(OPENDMARC_LIB_T)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:336: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 domain_buf[256]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:381: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 domain_buf[256]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:449: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 domain_buf[256]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:1649: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 nbuf[32]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:62: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 copy[sizeof spfctx->mailfrom_addr]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:125: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 xbuf[BUFSIZ]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:126: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 helo[512]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:127: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 mfrom[512]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:438: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[BUFSIZ]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:456: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. (void)memcpy(&low, &sin.sin_addr, sizeof(sin.sin_addr)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:457: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. (void)memcpy(&high, &sin.sin_addr, sizeof(sin.sin_addr)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:523: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 dotorcolon_str[2]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:524: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 dupe[BUFSIZ]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:585:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char strs[8][32]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:698: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 copy[128]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:755: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_str[256]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:823:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(&low_iary, &base_iary, sizeof(INT_ARY_T)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:824:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(&hi_iary, &base_iary, sizeof(INT_ARY_T)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:900: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 dupe[BUFSIZ]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:931: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 dcopy[MAXDNSHOSTNAME]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:932: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 scopy[MAXDNSHOSTNAME]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:933: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 scratch[MAXDNSHOSTNAME]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1046: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 scratch[MAXDNSHOSTNAME]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1244: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 domain[MAXDNSHOSTNAME]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1245: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 spf[SPF_MAX_SPF_RECORD_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1258: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 ipnum[64]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1435: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 abuf[BUFSIZ]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1491:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char a_abuf[BUFSIZ]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1566: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 mxbuf[BUFSIZ]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1608: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 spfbuf[SPF_MAX_SPF_RECORD_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1609: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 cname[MAXDNSHOSTNAME]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1610: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 query[MAXDNSHOSTNAME]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1642:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nbuf[16]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1688: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 p[2]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1849: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 query[MAXDNSHOSTNAME]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1851: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 cname[128]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1852: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 spfbuf[BUFSIZ]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1960: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 copy[sizeof spfctx->mailfrom_addr]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1990:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char copy[sizeof spfctx->mailfrom_addr]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:2046: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 cname[256]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:2047: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 spfbuf[BUFSIZ]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:2079: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 xbuf[BUFSIZ]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:58: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[MAXDNSHOSTNAME]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:59:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char namebuf[MAXDNSHOSTNAME + 1]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:92:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(hbuf, domain, sizeof hbuf); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:123:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(&hdr, a_buf, sizeof hdr); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:164: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 cname[MAXDNSHOSTNAME + 1]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:178: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. (void) memcpy(&in.s_addr, &a, sizeof(uint32_t)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:322: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 ip_buf[512]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:393: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 ptr[MAXDNSHOSTNAME + 1]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:473:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&hdr, a_q, sizeof hdr); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:478:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&hdr, aaaa_q, sizeof hdr); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:483:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&hdr, aaaa_q, sizeof hdr); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:533: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[MAXDNSHOSTNAME]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:534:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char namebuf[MAXDNSHOSTNAME + 1]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:562:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(hbuf, domain, sizeof hbuf); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:617:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(&hdr, txt_buf, sizeof hdr); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:676: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 xname[MAXDNSHOSTNAME + 1]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_tld.c:26:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char TLDfile[MAXPATHLEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_tld.c:136: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_fname, "r"); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:86:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. typedef char STACK[MAX_STACK_DEPTH][MAX_STACK_LINE_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:96: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 org_name[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:99: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 begin[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.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 end[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.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 source_ip[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:102: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 report_id[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:103: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 email[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:104: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 count[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:105: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 disposition[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.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 policy_eval_dkim[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.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 policy_eval_spf[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:108: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 domain[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:109: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 reason_type[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:110: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 reason_comment[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:111: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 adkim[8]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:112: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 aspf[8]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:113: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[32]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:114: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 pct[8]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:115: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 header_from[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:116: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 auth_dkim_domain[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:117: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 auth_dkim_result[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:118: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 auth_dkim_human[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:119: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 auth_spf_domain[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c: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 auth_spf_result[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:121: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 auth_spf_human[MAX_ITEM_NAME_LEN]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:122: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 obuf[BUFSIZ * 2]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:123: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 e_buf[128]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:540: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 e_buf[128]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:584: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(fname, "r"); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_dns_lookup.c:27: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 txt_record[2048]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_parse_to_buf.c:14: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 small_buf[10]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_parse_to_buf.c:15:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char big_buf[BUFSIZ * 4]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_spf.c:27: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 human[512]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_spf.c:95: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 human[BUFSIZ]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_spf.c:123: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 errbuf[BUFSIZ]; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_xml_parse.c:21: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 ebuf[256]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/config.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 buf[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/config.c:156: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). in = fopen(file, "r"); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/config.c:597: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(value, &cur->cfg_bool, size); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/config.c:606: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(value, &cur->cfg_int, size); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/config.c:619: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(value, &cur->cfg_string, size); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.c:400:37: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. strlcat((char *) ar->ares_host, (char *) tokens[c], data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.c:413:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. (char *) tokens[c], data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.c:431:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. (char *) tokens[c], data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.c:459:57: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. (char *) tokens[c]); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.c:477:57: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. (char *) tokens[c]); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.c:495:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. (char *) tokens[c], data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.c:513:20: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. if (strcasecmp((char *) tokens[c], "reason") == 0) data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.c:536:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. (char *) tokens[c], data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.c:557:31: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. x = ares_convert(ptypes, (char *) tokens[c]); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.c:581:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. (char *) tokens[c], data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.c:601:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. (char *) tokens[c], data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.h:76: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 result_reason[MAXAVALUE + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.h:77: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 result_property[MAXPROPS][MAXAVALUE + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.h:78: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 result_value[MAXPROPS][MAXAVALUE + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.h:85: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 ares_host[DMARC_MAXHOSTNAMELEN + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-ar.h:86: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 ares_version[MAXAVALUE + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c:172: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(name_delim, (const void *) name, name_len); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c:173: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(name_delim + name_len, delim, delim_len); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c:186:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, field_value_ptr, field_value_len); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c:223: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(tmp, hdr, MIN(strlen(hdr), sizeof tmp - 1)); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c:256: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). aar->instance = atoi(tag_value); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c:311: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(tmp, hdr_arc, MIN_OF(strlen(hdr_arc), sizeof tmp - 1)); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcseal.c:161: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(name_delim, (const void *)name, name_len); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcseal.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(name_delim + name_len, delim, delim_len); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcseal.c:175:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, field_value_ptr, field_value_len); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcseal.c:211: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(tmp, hdr, MIN_OF(strlen(hdr), sizeof tmp - 1)); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcseal.c:241:19: [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). as->instance = atoi(tag_value); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-dstring.c:108: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(new, dstr->ds_buf, dstr->ds_alloc); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-dstring.c:347: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(dstr->ds_buf + dstr->ds_len, str, nbytes); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:140: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 mctx_envfrom[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:141: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 mctx_envdomain[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:142: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 mctx_fromdomain[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:154: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 cctx_ipstr[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:155: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 cctx_host[MAXHOSTNAMELEN + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:157: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 cctx_helo[MAXHOSTNAMELEN + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:158: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 cctx_rawmfrom[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:287:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char myhostname[MAXHOSTNAMELEN + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:451: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 result[MAXSPFRESULT + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:613: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[BUFRSZ]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:617:6: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(path, "r"); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:680: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[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:685:6: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(path, "r"); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:973: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[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1014: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 ipbuf[MAXHOSTNAMELEN + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1031: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(&sin6, ip, sizeof sin6); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1033: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, &sin6.sin6_addr, sizeof addr); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1105: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, ip, sizeof sin); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1106: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, &sin.sin_addr, sizeof addr.s_addr); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1278: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 confstr[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1279: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 basedir[MAXPATHLEN + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1605: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 errbuf[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1638:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPATHLEN + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1994: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(&cc->cctx_ip, &sa, sizeof sa); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2004: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(&sa, ip, sizeof(struct sockaddr_in)); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2010: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(&cc->cctx_ip, ip, sizeof(struct sockaddr_in)); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2017: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(&sa, ip, sizeof(struct sockaddr_in6)); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2023: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(&cc->cctx_ip, ip, sizeof(struct sockaddr_in6)); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2298: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 header[MAXHEADER + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2299: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 addrbuf[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2300: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 replybuf[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2301: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 pdomain[MAXHOSTNAMELEN + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2951: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 human[512]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:3260: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 timebuf[BUFRSZ]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:3678: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). f = fopen(conf->conf_historyfile, "a"); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:4008: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). devnull = open(_PATH_DEVNULL, O_RDWR, 0); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:4168: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 argstr[MAXARGV]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:4169: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 err[BUFRSZ + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:4283:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPATHLEN + 1]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:4774: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). f = fopen(pidfile, "w"); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:5054: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). f = fopen(pidfile, "w"); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/test.c:359:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char symout[BUFRSZ]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/test.c:392: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[BUFRSZ]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/test.c:393: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[BUFRSZ]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/test.c:394: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 *envfrom[2]; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/test.c:697: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). f = fopen(file, "r"); data/opendmarc-1.4.0~beta1+dfsg/contrib/rddmarc/mysql_ip6.c:70: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). *length = strlen(result); data/opendmarc-1.4.0~beta1+dfsg/contrib/rddmarc/mysql_ip6.c:112:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, args->args[0], args->lengths[0]); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_dns.c:170:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(got_txtbuf, cur->fdns_answer, data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_dns.c:187:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(hbuf, domain, sizeof hbuf - 1); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_dns.c:193: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). bp = hbuf + strlen(hbuf) - 1; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:264:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ep = rev_sub + strlen(rev_sub) -1; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:270:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ep = rev_tld + strlen(rev_tld) -1; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:280: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). ret = strncasecmp(rev_tld, rev_sub, strlen(rev_tld)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:284:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ret = strncasecmp(rev_sub, rev_tld, strlen(rev_sub)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:293:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ep = rev_tld + strlen(rev_tld) -1; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:303: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). ret = strncasecmp(rev_tld, rev_sub, strlen(rev_tld)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:307:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ret = strncasecmp(rev_sub, rev_tld, strlen(rev_sub)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:341: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 (from_domain == NULL || strlen((char *)from_domain) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:386:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (domain == NULL || strlen((char *)domain) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:455: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). if (d_equal_domain == NULL || strlen((char *)d_equal_domain) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:473:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (dp == NULL || strlen(dp) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:725:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (domain == NULL || strlen(domain) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:759:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tld) > 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:907:58: [1] (buffer) strlen: Does not handle 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 (pctx == NULL || domain == NULL || record == NULL || strlen((char *)record) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:919: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). ep = copy + strlen((char *)copy); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:937: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). if (cp == NULL || strlen((char *)cp) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:943: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). if (vp == NULL || strlen((char *)vp) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:970:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncasecmp((char *)vp, "reject", strlen((char *)vp)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:972:45: [1] (buffer) strlen: Does not handle 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 (strncasecmp((char *)vp, "none", strlen((char *)vp)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:974:51: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (strncasecmp((char *)vp, "quarantine", strlen((char *)vp)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:988:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncasecmp((char *)vp, "reject", strlen((char *)vp)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:990:45: [1] (buffer) strlen: Does not handle 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 (strncasecmp((char *)vp, "none", strlen((char *)vp)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:992:51: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (strncasecmp((char *)vp, "quarantine", strlen((char *)vp)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:1006:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncasecmp((char *)vp, "strict", strlen((char *)vp)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:1008:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (strncasecmp((char *)vp, "relaxed", strlen((char *)vp)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:1022:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncasecmp((char *)vp, "strict", strlen((char *)vp)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:1024:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (strncasecmp((char *)vp, "relaxed", strlen((char *)vp)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:1077: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). if (xp != NULL && strlen((char *)xp) > 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:1083:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncasecmp((char *)xp, "afrf", strlen((char *)xp)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:1085:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (strncasecmp((char *)xp, "iodef", strlen((char *)xp)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:1119: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). if (xp != NULL && strlen((char *)xp) > 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:1151: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). if (xp != NULL && strlen((char *)xp) > 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:1178: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). if (xp != NULL && strlen((char *)xp) > 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_policy.c:1505:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy((char *)buf, (char *)which, buflen); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:157:59: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ret = opendmarc_spf2_specify_ip_address(ctx, ip_address, strlen(ip_address)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:550: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). ep = dupe + strlen(dupe); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:719: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(cp) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:910:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (cp = dupe + strlen(dupe) - 1; cp > dupe; --cp) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:961: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). dlen = strlen(dcopy); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:962: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). slen = strlen(scopy); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1051:54: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (spfctx == NULL || str == NULL || buf == NULL || strlen(str) > buflen) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1056: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). ep = str + strlen(str); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1302: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(spfctx->spf_record); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1320: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). SPF_EP = stack[s].spf + strlen(stack[s].spf); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1613: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). if (vp == NULL || strlen(vp) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1678:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). SPF_EP = stack[s].spf + strlen(stack[s].spf); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1776: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). if (vp == NULL || strlen(vp) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1820: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). if (vp == NULL || strlen(vp) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1888:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). SPF_EP = stack[s].spf + strlen(stack[s].spf); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:1893: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). if (strlen(SPF_SP) > 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:2109:62: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ret = opendmarc_spf_specify_mailfrom(ctx, mail_from_domain, strlen(mail_from_domain), used_mfrom); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:2118:60: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ret = opendmarc_spf_specify_helo_domain(ctx, helo_domain, strlen(helo_domain)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:2127:58: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ret = opendmarc_spf_specify_ip_address(ctx, ip_address, strlen(ip_address)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf.c:2139: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(spf_record); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:98: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). bp = hbuf + strlen(hbuf) - 1; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:181:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(hbuf, inet_ntoa(in), sizeof hbuf); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_spf_dns.c:570: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). bp = hbuf + strlen(hbuf) - 1; data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_strl.c:61: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). return strlen(src); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_strl.c:68:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return i + strlen(src + i); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_strl.c:106: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). o = strlen(dst); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_strl.c:108:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return o + strlen(src); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_strl.c:116:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return j + strlen(src + i); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_tld.c:49:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(cp) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_tld.c:57: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). ep = copy + strlen((char *)copy); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_tld.c:154: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). if (strncmp(commentstring, (char *)buf, strlen(commentstring)) == 0 || *buf == '\0') data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_tld.c:174:54: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (drop != NULL && strncasecmp(drop, (char *)buf, strlen(drop)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_tld.c:176: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). preflen = strlen(drop); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_tld.c:179:58: [1] (buffer) strlen: Does not handle 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 (except != NULL && strncasecmp(except, (char *)buf, strlen(except)) == 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_tld.c:181: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). preflen = strlen(except); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_tld.c:191:61: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vp = opendmarc_hash_lookup(hashp, revbuf, (void *)revbuf, strlen(revbuf)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_tld.c:267: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). for (rp = revbuf + strlen(revbuf) -1; rp > revbuf; --rp) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_util.c:163:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (str == NULL || buf == NULL || strlen((char *)str) > buflen) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_util.c:213: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((char *)raw); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_util.c:216:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(copy, raw, len); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_util.c:272: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). ep = copy + strlen((char *)copy); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_util.c:336: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((char *)cp); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_util.c:339: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((char *)cp); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:480:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(reason_type) > 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/opendmarc_xml.c:487:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(reason_comment) > 0) data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_spf.c:130:52: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (void) opendmarc_spf_specify_mailfrom(ctx, mfrom, strlen(mfrom), &use_mfrom); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_spf.c:131:54: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (void) opendmarc_spf_specify_helo_domain(ctx, helo, strlen(helo)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_spf.c:132:51: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (void) opendmarc_spf_specify_ip_address(ctx, ip, strlen(ip)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_spf.c:133:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (void) opendmarc_spf_specify_record(ctx, spf, strlen(spf)); data/opendmarc-1.4.0~beta1+dfsg/libopendmarc/tests/test_tld.c:34: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). if (memcmp(tldp->tld, tldbuf, strlen(tldp->tld)) == 0) data/opendmarc-1.4.0~beta1+dfsg/opendmarc/config.c:211: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). q = p + strlen(p) - 1; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c:164: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). name_len = strlen(name); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c:165: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). delim_len = strlen(delim); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c:177: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). field_value_ptr = field + strlen(name_delim); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c:180: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). field_value_len = strlen(field_value_ptr); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c:223: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). memcpy(tmp, hdr, MIN(strlen(hdr), sizeof tmp - 1)); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcares.c:311:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy(tmp, hdr_arc, MIN_OF(strlen(hdr_arc), sizeof tmp - 1)); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcseal.c:153: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). name_len = strlen(name); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcseal.c:154: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). delim_len = strlen(delim); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcseal.c:166: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). field_value_ptr = field + strlen(name_delim); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcseal.c:169: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). field_value_len = strlen(field_value_ptr); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-arcseal.c:211: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). memcpy(tmp, hdr, MIN_OF(strlen(hdr), sizeof tmp - 1)); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-dstring.c:202: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((char *) str); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc-dstring.c:245: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((char *) str) + dstr->ds_len; data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1140: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). c = strlen(ipbuf); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1325:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(basedir, str, sizeof basedir - 1); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1641:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path, conffile, sizeof path - 1); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:1984:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cc->cctx_host, host, sizeof cc->cctx_host - 1); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2071:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cc->cctx_helo, helo_domain, data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2145:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cc->cctx_rawmfrom, envfrom[0], data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2148:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dfc->mctx_envfrom, envfrom[0], data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2151: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(dfc->mctx_envfrom); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2170:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dfc->mctx_envdomain, p + 1, strlen(p + 1)); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2170:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncpy(dfc->mctx_envdomain, p + 1, strlen(p + 1)); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2419:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(addrbuf, from->hdr_value, sizeof addrbuf - 1); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2448:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dfc->mctx_fromdomain, domain, sizeof dfc->mctx_fromdomain - 1); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:2672:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(addrbuf, data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:3656:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(addrbuf, val, sizeof addrbuf - 1); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:4957:10: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). (void) umask((mode_t) filemask); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/opendmarc.c:5102:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(libopendmarc.tld_source_file, curconf->conf_pslist, data/opendmarc-1.4.0~beta1+dfsg/opendmarc/parse.c:59: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). e = s + strlen(s); data/opendmarc-1.4.0~beta1+dfsg/opendmarc/parse.c:372: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). e = line + strlen((char *) line); ANALYSIS SUMMARY: Hits = 330 Lines analyzed = 19056 in approximately 0.47 seconds (40757 lines/second) Physical Source Lines of Code (SLOC) = 13830 Hits@level = [0] 278 [1] 121 [2] 196 [3] 8 [4] 5 [5] 0 Hits@level+ = [0+] 608 [1+] 330 [2+] 209 [3+] 13 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 43.9624 [1+] 23.8612 [2+] 15.1121 [3+] 0.939986 [4+] 0.361533 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.