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/libspf2-1.2.10/src/spf_example/spf_example.c Examining data/libspf2-1.2.10/src/include/spf_record.h Examining data/libspf2-1.2.10/src/include/spf_dns_test.h Examining data/libspf2-1.2.10/src/include/spf_sys_config.h Examining data/libspf2-1.2.10/src/include/spf_win32.h Examining data/libspf2-1.2.10/src/include/spf_internal.h Examining data/libspf2-1.2.10/src/include/spf.h Examining data/libspf2-1.2.10/src/include/spf_dns_rr.h Examining data/libspf2-1.2.10/src/include/spf_win32_internal.h Examining data/libspf2-1.2.10/src/include/spf_dns_resolv.h Examining data/libspf2-1.2.10/src/include/spf_request.h Examining data/libspf2-1.2.10/src/include/spf_dns_zone.h Examining data/libspf2-1.2.10/src/include/spf_dns_windns.h Examining data/libspf2-1.2.10/src/include/spf_dns_cache.h Examining data/libspf2-1.2.10/src/include/spf_response.h Examining data/libspf2-1.2.10/src/include/spf_dns_null.h Examining data/libspf2-1.2.10/src/include/spf_server.h Examining data/libspf2-1.2.10/src/include/spf_dns_internal.h Examining data/libspf2-1.2.10/src/include/spf_lib_version.h Examining data/libspf2-1.2.10/src/include/spf_dns.h Examining data/libspf2-1.2.10/src/include/spf_log.h Examining data/libspf2-1.2.10/src/spfquery/spfquery.c Examining data/libspf2-1.2.10/src/libspf2/spf_utils.c Examining data/libspf2-1.2.10/src/libspf2/spf_dns_null.c Examining data/libspf2-1.2.10/src/libspf2/spf_print.c Examining data/libspf2-1.2.10/src/libspf2/spf_dns_zone.c Examining data/libspf2-1.2.10/src/libspf2/spf_response.c Examining data/libspf2-1.2.10/src/libspf2/spf_dns_windns.c Examining data/libspf2-1.2.10/src/libspf2/spf_record.c Examining data/libspf2-1.2.10/src/libspf2/spf_win32.c Examining data/libspf2-1.2.10/src/libspf2/spf_request.c Examining data/libspf2-1.2.10/src/libspf2/spf_dns_test.c Examining data/libspf2-1.2.10/src/libspf2/spf_dns.c Examining data/libspf2-1.2.10/src/libspf2/spf_log_default.c Examining data/libspf2-1.2.10/src/libspf2/spf_log_stdio.c Examining data/libspf2-1.2.10/src/libspf2/spf_expand.c Examining data/libspf2-1.2.10/src/libspf2/spf_get_spf.c Examining data/libspf2-1.2.10/src/libspf2/spf_dns_resolv.c Examining data/libspf2-1.2.10/src/libspf2/spf_get_exp.c Examining data/libspf2-1.2.10/src/libspf2/spf_compile.c Examining data/libspf2-1.2.10/src/libspf2/spf_log.c Examining data/libspf2-1.2.10/src/libspf2/spf_log_syslog.c Examining data/libspf2-1.2.10/src/libspf2/spf_strerror.c Examining data/libspf2-1.2.10/src/libspf2/spf_dns_cache.c Examining data/libspf2-1.2.10/src/libspf2/spf_dns_rr.c Examining data/libspf2-1.2.10/src/libspf2/spf_id2str.c Examining data/libspf2-1.2.10/src/libspf2/spf_interpret.c Examining data/libspf2-1.2.10/src/libspf2/spf_server.c Examining data/libspf2-1.2.10/src/libreplace/getopt.h Examining data/libspf2-1.2.10/src/libreplace/getopt_long_only.c Examining data/libspf2-1.2.10/src/libreplace/__ns_name_uncompress.c Examining data/libspf2-1.2.10/src/libreplace/__ns_initparse.c Examining data/libspf2-1.2.10/src/libreplace/memcmp.c Examining data/libspf2-1.2.10/src/libreplace/malloc.c Examining data/libspf2-1.2.10/src/libreplace/arpa_nameser.h Examining data/libspf2-1.2.10/src/libreplace/realloc.c Examining data/libspf2-1.2.10/src/libreplace/strncasecmp.c Examining data/libspf2-1.2.10/src/libreplace/__ns_msg_getflag.c Examining data/libspf2-1.2.10/src/libreplace/__ns_get16.c Examining data/libspf2-1.2.10/src/libreplace/win32_config.h Examining data/libspf2-1.2.10/src/spftest/spftest.c Examining data/libspf2-1.2.10/src/spfd/spfd.c FINAL RESULTS: data/libspf2-1.2.10/src/include/spf_log.h:41:123: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void SPF_errorx( const char *file, int line, const char *format, ... ) __attribute__ ((noreturn)) __attribute__ ((format (printf, 3, 4))); data/libspf2-1.2.10/src/include/spf_log.h:43:130: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void SPF_errorv( const char *file, int line, const char *format, va_list ap ) __attribute__ ((noreturn)) __attribute__ ((format (printf, 3, 0))); data/libspf2-1.2.10/src/include/spf_log.h:46:98: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void SPF_warningx( const char *file, int line, const char *format, ... ) __attribute__ ((format (printf, 3, 4))); data/libspf2-1.2.10/src/include/spf_log.h:48:105: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void SPF_warningv( const char *file, int line, const char *format, va_list ap ) __attribute__ ((format (printf, 3, 0))); data/libspf2-1.2.10/src/include/spf_log.h:51:95: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void SPF_infox( const char *file, int line, const char *format, ... ) __attribute__ ((format (printf, 3, 4))); data/libspf2-1.2.10/src/include/spf_log.h:53:102: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void SPF_infov( const char *file, int line, const char *format, va_list ap ) __attribute__ ((format (printf, 3, 0))); data/libspf2-1.2.10/src/include/spf_log.h:56:96: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void SPF_debugx( const char *file, int line, const char *format, ... ) __attribute__ ((format (printf, 3, 4))); data/libspf2-1.2.10/src/include/spf_log.h:58:103: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void SPF_debugv( const char *file, int line, const char *format, va_list ap ) __attribute__ ((format (printf, 3, 0))); data/libspf2-1.2.10/src/include/spf_win32_internal.h:32:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf _snprintf data/libspf2-1.2.10/src/include/spf_win32_internal.h:32:18: [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. #define snprintf _snprintf data/libspf2-1.2.10/src/include/spf_win32_internal.h:33: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. #define vsnprintf _vsnprintf data/libspf2-1.2.10/src/libreplace/__ns_name_uncompress.c:51:28: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. # define SPRINTF(x) strlen(sprintf/**/x) data/libspf2-1.2.10/src/libreplace/__ns_name_uncompress.c:53:30: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. # define SPRINTF(x) ((size_t)sprintf x) data/libspf2-1.2.10/src/libreplace/win32_config.h:9:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf _snprintf data/libspf2-1.2.10/src/libreplace/win32_config.h:9:18: [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. #define snprintf _snprintf data/libspf2-1.2.10/src/libreplace/win32_config.h:10: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. #define vsnprintf _vsnprintf data/libspf2-1.2.10/src/libspf2/spf_dns_cache.c:337:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(cached_rr->domain, domain); data/libspf2-1.2.10/src/libspf2/spf_dns_resolv.c:509:6: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(spfrr->rr[cnt]->mx, name_buf); data/libspf2-1.2.10/src/libspf2/spf_dns_resolv.c:584:6: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(spfrr->rr[cnt]->ptr, name_buf); data/libspf2-1.2.10/src/libspf2/spf_dns_rr.c:222:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(dst->rr[i]->ptr, src->rr[i]->ptr); data/libspf2-1.2.10/src/libspf2/spf_dns_rr.c:227:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(dst->rr[i]->mx, src->rr[i]->mx); data/libspf2-1.2.10/src/libspf2/spf_dns_rr.c:233:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(dst->rr[i]->txt, src->rr[i]->txt); data/libspf2-1.2.10/src/libspf2/spf_dns_windns.c:114:8: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). if ( strcat( buffer, strings[i] ) == NULL ) data/libspf2-1.2.10/src/libspf2/spf_dns_windns.c:171:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy( spfrr->domain, domain ); data/libspf2-1.2.10/src/libspf2/spf_dns_windns.c:398:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy( spfrr->rr[cnt]->mx, pMX_data->pNameExchange ); data/libspf2-1.2.10/src/libspf2/spf_dns_windns.c:429:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy( spfrr->rr[cnt]->ptr, pPTR_data->pNameHost ); data/libspf2-1.2.10/src/libspf2/spf_dns_zone.c:277:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy( spfrr->rr[cnt]->mx, data ); data/libspf2-1.2.10/src/libspf2/spf_dns_zone.c:283:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy( spfrr->rr[cnt]->txt, data ); data/libspf2-1.2.10/src/libspf2/spf_dns_zone.c:288:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy( spfrr->rr[cnt]->ptr, data ); data/libspf2-1.2.10/src/libspf2/spf_get_exp.c:72:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(*bufp, SPF_LAME_EXP); data/libspf2-1.2.10/src/libspf2/spf_log.c:44:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(errmsg, sizeof(errmsg), format, ap); data/libspf2-1.2.10/src/libspf2/spf_log.c:62:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(errmsg, sizeof(errmsg), format, ap); data/libspf2-1.2.10/src/libspf2/spf_log.c:79:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(errmsg, sizeof(errmsg), format, ap); data/libspf2-1.2.10/src/libspf2/spf_log.c:96:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(errmsg, sizeof(errmsg), format, ap); data/libspf2-1.2.10/src/libspf2/spf_log.c:116:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(errmsg, sizeof(errmsg), format, ap); data/libspf2-1.2.10/src/libspf2/spf_log.c:131:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(errmsg, sizeof(errmsg), format, ap); data/libspf2-1.2.10/src/libspf2/spf_log.c:144:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(errmsg, sizeof(errmsg), format, ap); data/libspf2-1.2.10/src/libspf2/spf_log.c:157:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(errmsg, sizeof(errmsg), format, ap); data/libspf2-1.2.10/src/libspf2/spf_request.c:178:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(sr->env_from, "postmaster@%s", from); data/libspf2-1.2.10/src/libspf2/spf_request.c:372:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(record, len, SPF_VER_STR " mx:%s", rcpt_to_dom); data/libspf2-1.2.10/src/libspf2/spf_response.c:200:12: [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. size = vsnprintf(buf, sizeof(buf), format, ap); data/libspf2-1.2.10/src/libspf2/spf_win32.c:158:17: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy( name, he->h_name ); data/libspf2-1.2.10/src/spfquery/spfquery.c:140:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(result, partial_result); \ data/libspf2-1.2.10/src/libreplace/getopt.h:104:12: [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. extern int getopt (int argc, char *const *argv, const char *shortopts); data/libspf2-1.2.10/src/libreplace/getopt.h:109:12: [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. extern int getopt (); data/libspf2-1.2.10/src/libreplace/getopt.h:112:12: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long (int argc, char *const *argv, const char *shortopts, data/libspf2-1.2.10/src/libreplace/getopt.h:124:12: [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. extern int getopt (); data/libspf2-1.2.10/src/libreplace/getopt.h:125:12: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long (); data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:212:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *getenv (); data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:403:21: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. posixly_correct = getenv ("POSIXLY_CORRECT"); data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:968:1: [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. getopt (argc, argv, optstring) data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:980:1: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long (argc, argv, optstring, longopts, longindex) data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:1027:11: [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. c = getopt (argc, argv, "abc:d:0123456789"); data/libspf2-1.2.10/src/spf_example/spf_example.c:143:6: [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. c = getopt(argc, argv, "i:s:h:r:d::" ); data/libspf2-1.2.10/src/spfd/spfd.c:510:3: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long(argc, argv, shortopts, longopts, &idx) data/libspf2-1.2.10/src/include/spf_dns_rr.h:34: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 ptr[1]; data/libspf2-1.2.10/src/include/spf_dns_rr.h:35: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 mx[1]; data/libspf2-1.2.10/src/include/spf_dns_rr.h:36: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 txt[1]; data/libspf2-1.2.10/src/libreplace/__ns_name_uncompress.c:63:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char digitvalue[256] = { data/libspf2-1.2.10/src/libreplace/__ns_name_uncompress.c:427:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dstp, srcp, l); data/libspf2-1.2.10/src/libreplace/__ns_name_uncompress.c:561: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(dstp, srcp, n + 1); data/libspf2-1.2.10/src/libreplace/arpa_nameser.h:187:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[NS_MAXDNAME]; data/libspf2-1.2.10/src/libreplace/arpa_nameser.h:271: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 name[NS_MAXDNAME], alg[NS_MAXDNAME]; data/libspf2-1.2.10/src/libreplace/arpa_nameser.h:284: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 sig[NS_PACKETSZ]; data/libspf2-1.2.10/src/libspf2/spf_compile.c:557:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, &src[idx], len); data/libspf2-1.2.10/src/libspf2/spf_compile.c:732:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[ INET6_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_compile.c:759: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, start, len ); data/libspf2-1.2.10/src/libspf2/spf_compile.c:781:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[ INET6_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_compile.c:808: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, start, len ); data/libspf2-1.2.10/src/libspf2/spf_compile.c:832: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[SPF_RECORD_BUFSIZ]; data/libspf2-1.2.10/src/libspf2/spf_compile.c:968:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( (char *)spf_record->mech_first + spf_record->mech_len, data/libspf2-1.2.10/src/libspf2/spf_compile.c:990: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[SPF_RECORD_BUFSIZ]; data/libspf2-1.2.10/src/libspf2/spf_compile.c:1019: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(SPF_mod_name(spf_modifier), mod_name, name_len); data/libspf2-1.2.10/src/libspf2/spf_compile.c:1044:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( (char *)spf_record->mod_first + spf_record->mod_len, data/libspf2-1.2.10/src/libspf2/spf_compile.c:1505:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[sizeof(SPF_macro_t) + SPF_MAX_MOD_LEN]; data/libspf2-1.2.10/src/libspf2/spf_compile.c:1527: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(*spf_macrop, ALIGNED_DECL(buf), size); data/libspf2-1.2.10/src/libspf2/spf_dns.c:62:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ip4_buf[ INET_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_dns.c:63: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 ip6_buf[ INET6_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_dns.c:153:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char domain[ sizeof("111.222.333.444.in-addr.arpa") ]; data/libspf2-1.2.10/src/libspf2/spf_dns.c:156:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char x[4]; data/libspf2-1.2.10/src/libspf2/spf_dns.c:174: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[ sizeof(struct in6_addr) * 4 + sizeof(".ip6.arpa" ) + 1]; /* nibbles */ data/libspf2-1.2.10/src/libspf2/spf_dns_resolv.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 ip4_buf[ INET_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_dns_resolv.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 ip6_buf[ INET6_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_dns_resolv.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 name_buf[ NS_MAXDNAME ]; data/libspf2-1.2.10/src/libspf2/spf_dns_resolv.c:237:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name_buf[ NS_MAXDNAME ]; data/libspf2-1.2.10/src/libspf2/spf_dns_resolv.c:540:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, src, len); data/libspf2-1.2.10/src/libspf2/spf_dns_windns.c:135: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 ip4_buf[ INET_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_dns_windns.c:136: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 ip6_buf[ INET6_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_expand.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 ip4_buf[ INET_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_expand.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 ip6_buf[ INET6_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_expand.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 ip6_rbuf[ sizeof( struct in6_addr ) * 4 + 1 ]; data/libspf2-1.2.10/src/libspf2/spf_expand.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 time_buf[ sizeof( "4294967296" ) ]; /* 2^32 seconds max */ data/libspf2-1.2.10/src/libspf2/spf_expand.c:156:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, SPF_data_str(d), d->ds.len); data/libspf2-1.2.10/src/libspf2/spf_expand.c:304:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( p_write, p_read + 1, len ); data/libspf2-1.2.10/src/libspf2/spf_expand.c:318:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( p_write, p_read + 1, len ); data/libspf2-1.2.10/src/libspf2/spf_expand.c:404:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( p_write, "%%%02x", *p_read ); data/libspf2-1.2.10/src/libspf2/spf_id2str.c:257: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 ip4_buf[ INET_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_id2str.c: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 ip6_buf[ INET6_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:90: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[SPF_SMTP_COMMENT_SIZE]; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:145:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ip4_buf[ INET_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:146: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 ip6_buf[ INET6_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:277: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 ip4_buf[ INET_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:278: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 ip6_buf[ INET6_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:463: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 src_ip4_buf[ INET_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:464: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 dst_ip4_buf[ INET_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:465: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 mask_ip4_buf[ INET_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:504: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 src_ip6_buf[ INET6_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:505: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 dst_ip6_buf[ INET6_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:630:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ip4_buf[ INET_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:631:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ip6_buf[ INET6_ADDRSTRLEN ]; data/libspf2-1.2.10/src/libspf2/spf_log.c:37: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 errmsg[SPF_SYSLOG_SIZE]; data/libspf2-1.2.10/src/libspf2/spf_log.c:55: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 errmsg[SPF_SYSLOG_SIZE]; data/libspf2-1.2.10/src/libspf2/spf_log.c:72:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char errmsg[SPF_SYSLOG_SIZE]; data/libspf2-1.2.10/src/libspf2/spf_log.c:89: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 errmsg[SPF_SYSLOG_SIZE]; data/libspf2-1.2.10/src/libspf2/spf_log.c:111: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 errmsg[SPF_SYSLOG_SIZE]; data/libspf2-1.2.10/src/libspf2/spf_log.c:126: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 errmsg[SPF_SYSLOG_SIZE]; data/libspf2-1.2.10/src/libspf2/spf_log.c:139: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 errmsg[SPF_SYSLOG_SIZE]; data/libspf2-1.2.10/src/libspf2/spf_log.c:152: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 errmsg[SPF_SYSLOG_SIZE]; data/libspf2-1.2.10/src/libspf2/spf_log_stdio.c:36:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/libspf2-1.2.10/src/libspf2/spf_log_stdio.c:50:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/libspf2-1.2.10/src/libspf2/spf_log_stdio.c:69:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/libspf2-1.2.10/src/libspf2/spf_log_syslog.c:40:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/libspf2-1.2.10/src/libspf2/spf_log_syslog.c:54:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/libspf2-1.2.10/src/libspf2/spf_log_syslog.c:73:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128] = ""; data/libspf2-1.2.10/src/libspf2/spf_response.c:193:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[SPF_ERRMSGSIZE]; data/libspf2-1.2.10/src/libspf2/spf_win32.c:62: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( &src_sockaddr.sin_addr, src, sizeof( struct in_addr ) ); data/libspf2-1.2.10/src/libspf2/spf_win32.c:71: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( &src6_sockaddr.sin6_addr, src, sizeof( struct in6_addr ) ); data/libspf2-1.2.10/src/libspf2/spf_win32.c:129:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( dst, &((struct sockaddr_in*)pDst_sockaddr)->sin_addr, data/libspf2-1.2.10/src/libspf2/spf_win32.c:133:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( dst, &pDst_sockaddr->sin6_addr, data/libspf2-1.2.10/src/spf_example/spf_example.c:177:15: [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). opt_debug = atoi( optarg ); data/libspf2-1.2.10/src/spfd/spfd.c:184: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 fmt[4096]; data/libspf2-1.2.10/src/spfd/spfd.c:473:18: [2] (integer) atol: 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). pwd = getpwuid(atol(arg)); data/libspf2-1.2.10/src/spfd/spfd.c:490:18: [2] (integer) atol: 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). grp = getgrgid(atol(arg)); data/libspf2-1.2.10/src/spfd/spfd.c:514:27: [2] (integer) atol: 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). spfd_config.tcpport = atol(optarg); data/libspf2-1.2.10/src/spfd/spfd.c:517:27: [2] (integer) atol: 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). spfd_config.udpport = atol(optarg); data/libspf2-1.2.10/src/spfd/spfd.c:524:25: [2] (integer) atol: 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). spfd_config.debug = atol(optarg); data/libspf2-1.2.10/src/spfd/spfd.c:539:28: [2] (integer) atol: 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). spfd_config.pathmode = atol(optarg); data/libspf2-1.2.10/src/spfd/spfd.c:816:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char key[BUFSIZ]; data/libspf2-1.2.10/src/spfd/spfd.c:868: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[4096]; data/libspf2-1.2.10/src/spfd/spfd.c:903: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(&sfd, &rfd, sizeof(rfd)); data/libspf2-1.2.10/src/spfquery/spfquery.c:349: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 in_line[4096]; data/libspf2-1.2.10/src/spfquery/spfquery.c:420:26: [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). opts->use_trusted = atoi(optarg); data/libspf2-1.2.10/src/spfquery/spfquery.c:432:24: [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). opts->max_lookup = atoi(optarg); data/libspf2-1.2.10/src/spfquery/spfquery.c:436:22: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). opts->sanitize = atoi(optarg); data/libspf2-1.2.10/src/spfquery/spfquery.c:481: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). opts->debug = atoi( optarg ); data/libspf2-1.2.10/src/spfquery/spfquery.c:540:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fin = fopen( opt_file, "r" ); data/libspf2-1.2.10/src/spftest/spftest.c:170:3: [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( spf_rec, "v=spf1 exp-text=" ); data/libspf2-1.2.10/src/libreplace/__ns_name_uncompress.c:51: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). # define SPRINTF(x) strlen(sprintf/**/x) data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:236:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). extern int strlen (const char *); data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:434:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = nonoption_flags_max_len = strlen (orig_str); data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:655: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). == (unsigned int) strlen (p->name)) data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:679:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nextchar += strlen (nextchar); data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:711: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). nextchar += strlen (nextchar); data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:727: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). nextchar += strlen (nextchar); data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:732:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nextchar += strlen (nextchar); data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:843: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). if ((unsigned int) (nameend - nextchar) == strlen (p->name)) data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:866:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nextchar += strlen (nextchar); data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:886: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). nextchar += strlen (nextchar); data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:900: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). nextchar += strlen (nextchar); data/libspf2-1.2.10/src/libreplace/getopt_long_only.c:904:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nextchar += strlen (nextchar); data/libspf2-1.2.10/src/libspf2/spf_compile.c:1517: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). record, strlen(record), data/libspf2-1.2.10/src/libspf2/spf_dns_cache.c:328: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). size_t new_len = strlen(domain) + 1; data/libspf2-1.2.10/src/libspf2/spf_dns_resolv.c:503: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). strlen(name_buf) + 1 ) != SPF_E_SUCCESS) { data/libspf2-1.2.10/src/libspf2/spf_dns_resolv.c:578: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). strlen(name_buf) + 1) != SPF_E_SUCCESS) { data/libspf2-1.2.10/src/libspf2/spf_dns_rr.c:79: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). spfrr->domain_buf_len = strlen(domain) + 1; data/libspf2-1.2.10/src/libspf2/spf_dns_rr.c:221: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). SPF_DNS_RR_REALLOC(dst, i, strlen(src->rr[i]->ptr) + 1); data/libspf2-1.2.10/src/libspf2/spf_dns_rr.c:226: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). SPF_DNS_RR_REALLOC(dst, i, strlen(src->rr[i]->mx) + 1); data/libspf2-1.2.10/src/libspf2/spf_dns_rr.c:232: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). SPF_DNS_RR_REALLOC(dst, i, strlen(src->rr[i]->txt) + 1); data/libspf2-1.2.10/src/libspf2/spf_dns_windns.c:99: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). length = length + strlen(strings[i]); data/libspf2-1.2.10/src/libspf2/spf_dns_windns.c:160: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). size_t new_len = strlen( domain ) + 1; data/libspf2-1.2.10/src/libspf2/spf_dns_windns.c:394: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). spfrr, cnt, strlen( pMX_data->pNameExchange ) + 1 data/libspf2-1.2.10/src/libspf2/spf_dns_windns.c:425: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). spfrr, cnt, strlen( pPTR_data->pNameHost ) + 1 data/libspf2-1.2.10/src/libspf2/spf_dns_zone.c:121:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t domain_len = strlen(domain); data/libspf2-1.2.10/src/libspf2/spf_dns_zone.c:138: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). size_t zdomain_len = strlen(spfhook->zone[i]->domain) - 2; data/libspf2-1.2.10/src/libspf2/spf_dns_zone.c:150: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). strlen(spfhook->zone[i]->domain) == domain_len) { data/libspf2-1.2.10/src/libspf2/spf_dns_zone.c:276:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). SPF_RR_TRY_REALLOC(spfrr, cnt, strlen( data ) + 1); data/libspf2-1.2.10/src/libspf2/spf_dns_zone.c:282:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). SPF_RR_TRY_REALLOC(spfrr, cnt, strlen( data ) + 1); data/libspf2-1.2.10/src/libspf2/spf_dns_zone.c:287:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). SPF_RR_TRY_REALLOC(spfrr, cnt, strlen( data ) + 1); data/libspf2-1.2.10/src/libspf2/spf_expand.c:275:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(var); data/libspf2-1.2.10/src/libspf2/spf_interpret.c:181: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( sender_dom ) + sizeof( "domain of " ); data/libspf2-1.2.10/src/libspf2/spf_interpret.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( SPF_request_get_rec_dom(spf_request) ) + strlen( spf_source ) + strlen( ip ) + 80; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:202:57: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen( SPF_request_get_rec_dom(spf_request) ) + strlen( spf_source ) + strlen( ip ) + 80; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:202:80: [1] (buffer) strlen: Does not handle 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_request_get_rec_dom(spf_request) ) + strlen( spf_source ) + strlen( ip ) + 80; data/libspf2-1.2.10/src/libspf2/spf_interpret.c:559: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). hlen = strlen(hostname); data/libspf2-1.2.10/src/libspf2/spf_interpret.c:560: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(domain); data/libspf2-1.2.10/src/libspf2/spf_record.c:89: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( mod_name ); data/libspf2-1.2.10/src/libspf2/spf_request.c:163:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sr->env_from_lp, from, len); data/libspf2-1.2.10/src/libspf2/spf_request.c:174: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). len = sizeof("postmaster@") + strlen(from); data/libspf2-1.2.10/src/libspf2/spf_request.c:368:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = sizeof(SPF_VER_STR) + 64 + strlen(rcpt_to_dom); data/libspf2-1.2.10/src/libspf2/spf_server.c:285: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). len = sizeof(SPF_VER_STR) + strlen(policy) + 20; data/libspf2-1.2.10/src/libspf2/spf_win32.c:155: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). fullnamelen = strlen( he->h_name ); data/libspf2-1.2.10/src/spfd/spfd.c:643:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(addr.sun_path, spfd_config.path, sizeof(addr.sun_path) - 1); data/libspf2-1.2.10/src/spfquery/spfquery.c:132:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (strlen(result) + n >= result_len) { \ data/libspf2-1.2.10/src/spfquery/spfquery.c:139:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). RESIZE_RESULT(strlen(partial_result)); \ data/libspf2-1.2.10/src/spftest/spftest.c:167: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( argv[2] ); ANALYSIS SUMMARY: Hits = 195 Lines analyzed = 17063 in approximately 0.52 seconds (32854 lines/second) Physical Source Lines of Code (SLOC) = 11391 Hits@level = [0] 187 [1] 48 [2] 92 [3] 12 [4] 43 [5] 0 Hits@level+ = [0+] 382 [1+] 195 [2+] 147 [3+] 55 [4+] 43 [5+] 0 Hits/KSLOC@level+ = [0+] 33.5352 [1+] 17.1188 [2+] 12.9049 [3+] 4.82837 [4+] 3.77491 [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.