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/gross-1.0.2/include/bloom.h Examining data/gross-1.0.2/include/check_blocker.h Examining data/gross-1.0.2/include/check_dnsbl.h Examining data/gross-1.0.2/include/check_random.h Examining data/gross-1.0.2/include/check_spf.h Examining data/gross-1.0.2/include/common.h Examining data/gross-1.0.2/include/conf.h Examining data/gross-1.0.2/include/msgqueue.h Examining data/gross-1.0.2/include/proto_sjsms.h Examining data/gross-1.0.2/include/sha256.h Examining data/gross-1.0.2/include/srvutils.h Examining data/gross-1.0.2/include/stats.h Examining data/gross-1.0.2/include/syncmgr.h Examining data/gross-1.0.2/include/thread_pool.h Examining data/gross-1.0.2/include/worker.h Examining data/gross-1.0.2/include/utils.h Examining data/gross-1.0.2/src/bloom-test.c Examining data/gross-1.0.2/src/bloom.c Examining data/gross-1.0.2/src/bloommgr.c Examining data/gross-1.0.2/src/check_blocker.c Examining data/gross-1.0.2/src/check_dnsbl.c Examining data/gross-1.0.2/src/check_random.c Examining data/gross-1.0.2/src/client_postfix.c Examining data/gross-1.0.2/src/client_sjsms.c Examining data/gross-1.0.2/src/conf.c Examining data/gross-1.0.2/src/gclient.c Examining data/gross-1.0.2/src/grosscheck.c Examining data/gross-1.0.2/src/msgqueue-test.c Examining data/gross-1.0.2/src/msgqueue.c Examining data/gross-1.0.2/src/proto_sjsms.c Examining data/gross-1.0.2/src/sha256-test.c Examining data/gross-1.0.2/src/sha256.c Examining data/gross-1.0.2/src/srvstatus.c Examining data/gross-1.0.2/src/srvutils.c Examining data/gross-1.0.2/src/stats.c Examining data/gross-1.0.2/src/syncmgr.c Examining data/gross-1.0.2/src/thread_pool.c Examining data/gross-1.0.2/src/utils.c Examining data/gross-1.0.2/src/worker.c Examining data/gross-1.0.2/src/worker_milter.c Examining data/gross-1.0.2/src/worker_postfix.c Examining data/gross-1.0.2/src/worker_sjsms.c Examining data/gross-1.0.2/src/gross.c FINAL RESULTS: data/gross-1.0.2/src/gross.c:122:5: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(buffer, " ; ", MAXLINELEN - 1); data/gross-1.0.2/src/gross.c:123:5: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(buffer, pp->value, MAXLINELEN - 1); data/gross-1.0.2/src/worker.c:672:3: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(line, buffer, MAXLINELEN - 1); data/gross-1.0.2/src/worker.c:678:3: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(line, buffer, MAXLINELEN - 1); data/gross-1.0.2/src/worker.c:681:4: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(line, buffer, MAXLINELEN - 1); data/gross-1.0.2/src/client_postfix.c:79:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(mbuf, MAXLINELEN * 4, data/gross-1.0.2/src/proto_sjsms.c:46:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(message.message, MAXLINELEN, fmt, vap); data/gross-1.0.2/src/srvutils.c:50:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(mbuf, MSGSZ, logfmt, vap); data/gross-1.0.2/src/srvutils.c:81:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(mbuf, MSGSZ, fmt, vap); data/gross-1.0.2/src/srvutils.c:108:3: [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(out, MSGSZ, logfmt, vap); data/gross-1.0.2/src/check_random.c:53:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/gross-1.0.2/src/client_postfix.c:40:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/gross-1.0.2/src/client_postfix.c:82:7: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. random(), random(), random(), random()); data/gross-1.0.2/src/client_postfix.c:82:17: [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. random(), random(), random(), random()); data/gross-1.0.2/src/client_postfix.c:82:27: [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. random(), random(), random(), random()); data/gross-1.0.2/src/client_postfix.c:82:37: [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. random(), random(), random(), random()); data/gross-1.0.2/src/gross.c:591: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, ":drf:VCDnp:P:u:")) != -1) { data/gross-1.0.2/include/bloom.h:71: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 magic[8]; data/gross-1.0.2/include/proto_sjsms.h:37: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 message[MAXLINELEN]; data/gross-1.0.2/include/proto_sjsms.h:48:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char message[MAXLINELEN]; data/gross-1.0.2/include/srvutils.h:84: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 mtext[MSGSZ]; data/gross-1.0.2/include/srvutils.h: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 mtext[MSGSZ]; data/gross-1.0.2/src/bloom-test.c:38: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 test[512] = { 0x00 }; data/gross-1.0.2/src/bloom-test.c:39: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[MAXLINELEN]; data/gross-1.0.2/src/bloom-test.c:172:4: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:182:3: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:193:3: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:261:3: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:270:3: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:300:3: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:306:3: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:318:4: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:327:4: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:357:3: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:363:3: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:375:4: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:384:4: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:410:3: [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(test, "%d", i); data/gross-1.0.2/src/bloom-test.c:415:3: [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(test, "%d", i); data/gross-1.0.2/src/bloom.c:234: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(tmp->filter, filter->filter, tmp->bitsize / BITS_PER_CHAR); data/gross-1.0.2/src/bloom.c:387: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(brq->aggregate->filter, tmp->filter, tmp->bitsize / BITS_PER_CHAR); data/gross-1.0.2/src/bloommgr.c:81: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(&digest, message.mtext, sizeof(sha_256_t)); data/gross-1.0.2/src/bloommgr.c:89: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(&digest, message.mtext, sizeof(sha_256_t)); data/gross-1.0.2/src/check_blocker.c:42:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[MAXLINELEN] = { '\0' }; data/gross-1.0.2/src/check_dnsbl.c:159: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 tmpstr[INET_ADDRSTRLEN]; data/gross-1.0.2/src/check_dnsbl.c:216:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[MAXQUERYSTRLEN]; data/gross-1.0.2/src/check_dnsbl.c:348: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(&ts, &timeleft, sizeof(timeleft)); data/gross-1.0.2/src/client_postfix.c:29: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 mbuf[MAXLINELEN * 4]; data/gross-1.0.2/src/client_postfix.c:30: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[MAXLINELEN]; data/gross-1.0.2/src/client_postfix.c:63: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). gserv.sin_port = htons(atoi(argv[8])); data/gross-1.0.2/src/client_postfix.c:75:10: [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). runs = atoi(argv[6]); data/gross-1.0.2/src/client_sjsms.c:29: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 recbuf[MAXLINELEN + 1]; data/gross-1.0.2/src/client_sjsms.c:52: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). gserv.sin_port = htons(atoi(argv[8])); data/gross-1.0.2/src/client_sjsms.c:59:10: [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). runs = atoi(argv[6]); data/gross-1.0.2/src/conf.c:64:11: [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). return atoi(paramcounts[i + 2]); data/gross-1.0.2/src/conf.c:85:11: [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). return atoi(paramcounts[i + 1]); data/gross-1.0.2/src/conf.c:303:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[MAXLINELEN]; data/gross-1.0.2/src/conf.c:304: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[MAXLINELEN]; data/gross-1.0.2/src/conf.c:306: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[1]; data/gross-1.0.2/src/conf.c:307: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 *value[1]; data/gross-1.0.2/src/conf.c:324:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(filename, O_RDONLY); data/gross-1.0.2/src/gross.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 buffer[MAXLINELEN] = { '\0' }; data/gross-1.0.2/src/gross.c:171:41: [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). ctx->config.sync_host.sin_port = htons(atoi(CONF("sync_port"))); data/gross-1.0.2/src/gross.c:172:42: [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). ctx->config.gross_host.sin_port = htons(atoi(CONF("port"))); data/gross-1.0.2/src/gross.c:176:31: [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). ctx->config.greylist_delay = atoi(CONF("grey_delay")); data/gross-1.0.2/src/gross.c:182:46: [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). ctx->config.peer.peer_addr.sin_port = htons(atoi(CONF("sync_port"))); data/gross-1.0.2/src/gross.c:229:43: [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). ctx->config.status_host.sin_port = htons(atoi(CONF("status_port"))); data/gross-1.0.2/src/gross.c:231:32: [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). ctx->config.rotate_interval = atoi(CONF("rotate_interval")); data/gross-1.0.2/src/gross.c:232:28: [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). ctx->config.filter_size = atoi(CONF("filter_bits")); data/gross-1.0.2/src/gross.c:233:25: [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). ctx->config.num_bufs = atoi(CONF("number_buffers")); data/gross-1.0.2/src/gross.c:272:31: [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). ctx->config.stat_interval = atoi(CONF("stat_interval")); data/gross-1.0.2/src/gross.c:329:39: [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). add_dnsbl(&ctx->dnsbl, cp->value, atoi(cp->params->value)); data/gross-1.0.2/src/gross.c:350:39: [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). add_dnsbl(&ctx->rhsbl, cp->value, atoi(cp->params->value)); data/gross-1.0.2/src/gross.c:359:32: [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). ctx->config.pool_maxthreads = atoi(CONF("pool_maxthreads")); data/gross-1.0.2/src/gross.c:361:32: [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). ctx->config.query_timelimit = atoi(CONF("query_timelimit")); data/gross-1.0.2/src/gross.c:385:31: [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). ctx->config.blocker.weight = atoi(CONF("blocker_weight")); data/gross-1.0.2/src/gross.c:472:47: [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). ctx->config.blocker.server.sin_port = htons(atoi(CONF("blocker_port"))); data/gross-1.0.2/src/gross.c:476:32: [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). ctx->config.grey_threshold = atoi(CONF("grey_threshold")); data/gross-1.0.2/src/gross.c:481:33: [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). ctx->config.block_threshold = atoi(CONF("block_threshold")); data/gross-1.0.2/src/grosscheck.c:56:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[SBUFLEN] = { 0x00 }; data/gross-1.0.2/src/grosscheck.c:57: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 sender[SBUFLEN] = { 0x00 }; data/gross-1.0.2/src/grosscheck.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 recipient[SBUFLEN] = { 0x00 }; data/gross-1.0.2/src/grosscheck.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 caddr[SBUFLEN] = { 0x00 }; data/gross-1.0.2/src/grosscheck.c:60: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[SBUFLEN] = { 0x00 }; data/gross-1.0.2/src/grosscheck.c:61: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 recbuf[MAXLINELEN] = { 0x00 }; data/gross-1.0.2/src/grosscheck.c:103: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). foo = fopen("/tmp/argout", "a"); data/gross-1.0.2/src/grosscheck.c:133:44: [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). gserv1.sin_port = gserv2.sin_port = htons(atoi(begin)); data/gross-1.0.2/src/grosscheck.c:272: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 bar[256]; data/gross-1.0.2/src/msgqueue.c:370:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void *)mq->delay_ts, ts, sizeof(struct timespec)); data/gross-1.0.2/src/msgqueue.c:437: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(msgp, omsgp, truesize); data/gross-1.0.2/src/msgqueue.c:476: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(msgp, omsgp, truesize); data/gross-1.0.2/src/msgqueue.c:674: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(msgp, msg->msgp, msglen + sizeof(long)); data/gross-1.0.2/src/proto_sjsms.c:31:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[MAXLINELEN]; data/gross-1.0.2/src/proto_sjsms.c:64: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(&message.message, request, message.msglen); data/gross-1.0.2/src/proto_sjsms.c:75: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(&message.message, querystr, message.msglen); data/gross-1.0.2/src/proto_sjsms.c:82: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(request, message->message, MIN(message->msglen, MAXLINELEN)); data/gross-1.0.2/src/proto_sjsms.c:91:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char querystr[MAXLINELEN] = { '\0' }; data/gross-1.0.2/src/sha256-test.c:41:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char message[MAX_MESSAGE_LEN] = { 0x00 }; data/gross-1.0.2/src/sha256-test.c:42: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 reference_digest[MAX_MESSAGE_LEN] = { 0x00 }; data/gross-1.0.2/src/sha256-test.c:43: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 digest_hex[MAX_MESSAGE_LEN] = { 0x00 }; data/gross-1.0.2/src/sha256.c:143:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((void *)digestable_message, (const void *)message, size); data/gross-1.0.2/src/srvstatus.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 statbuf[MSGSZ] = { 0x00 }; data/gross-1.0.2/src/srvutils.c:38: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 logfmt[MSGSZ] = { '\0' }; data/gross-1.0.2/src/srvutils.c:39: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 mbuf[MSGSZ] = { '\0' }; data/gross-1.0.2/src/srvutils.c:69: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 mbuf[MSGSZ] = { 0x00 }; data/gross-1.0.2/src/srvutils.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 logfmt[MSGSZ]; data/gross-1.0.2/src/srvutils.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 out[MSGSZ]; data/gross-1.0.2/src/srvutils.c:209:15: [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). statefile = fopen(ctx->config.statefile, "w"); data/gross-1.0.2/src/srvutils.c:270:43: [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). ctx->statefile_info->fd = open(ctx->config.statefile, O_RDWR); data/gross-1.0.2/src/srvutils.c:406: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). pf = fopen(ctx->config.pidfile, "w"); data/gross-1.0.2/src/srvutils.c:471:2: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). open("/dev/null", O_RDONLY, 0); data/gross-1.0.2/src/srvutils.c:473:2: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). open("/dev/null", O_WRONLY, 0); data/gross-1.0.2/src/srvutils.c:475:2: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). open("/dev/null", O_WRONLY, 0); data/gross-1.0.2/src/srvutils.c:555: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 timestr[DATESTRLEN]; data/gross-1.0.2/src/srvutils.c:556: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[MSGSZ]; data/gross-1.0.2/src/srvutils.c:591: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 ipstr[INET_ADDRSTRLEN]; data/gross-1.0.2/src/stats.c:226: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[TMP_BUF_SIZE] = { 0x00 }; data/gross-1.0.2/src/syncmgr.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 buf[sizeof(sync_msg_t) + sizeof(startup_sync_t)] = { 0x00 }; data/gross-1.0.2/src/syncmgr.c:163:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, &prologue, sizeof(sync_msg_t)); data/gross-1.0.2/src/syncmgr.c:164:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf + sizeof(sync_msg_t), &tmp, sizeof(startup_sync_t)); data/gross-1.0.2/src/syncmgr.c:172: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(sync_msg_t) + sizeof(oper_sync_t)] = { 0x00 }; data/gross-1.0.2/src/syncmgr.c:178: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, &prologue, sizeof(sync_msg_t)); data/gross-1.0.2/src/syncmgr.c:179: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 + sizeof(sync_msg_t), sync, sizeof(oper_sync_t)); data/gross-1.0.2/src/syncmgr.c:188: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(sync_msg_t) + sizeof(oper_sync_t)] = { 0x00 }; data/gross-1.0.2/src/syncmgr.c:196:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&digest, update->mtext, sizeof(sha_256_t)); data/gross-1.0.2/src/syncmgr.c:202:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, &prologue, sizeof(sync_msg_t)); data/gross-1.0.2/src/syncmgr.c:203:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf + sizeof(sync_msg_t), &os, sizeof(oper_sync_t)); data/gross-1.0.2/src/syncmgr.c:318: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(update.mtext, &msg, sizeof(msg)); data/gross-1.0.2/src/syncmgr.c:343: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(update.mtext, &(msg.digest), sizeof(msg.digest)); data/gross-1.0.2/src/syncmgr.c:422: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 ipstr[INET_ADDRSTRLEN]; data/gross-1.0.2/src/syncmgr.c:423: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 conn_ipstr[INET_ADDRSTRLEN]; data/gross-1.0.2/src/syncmgr.c:442: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(&sync_out, &ctx->config.sync_host, sizeof(struct sockaddr_in)); data/gross-1.0.2/src/worker.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 masked[INET_ADDRSTRLEN] = { '\0' }; data/gross-1.0.2/src/worker.c:192: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 maskedtuple[MSGSZ]; data/gross-1.0.2/src/worker.c:442: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(update.mtext, &digest, sizeof(sha_256_t)); data/gross-1.0.2/src/worker.c:628: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[MAXLINELEN]; data/gross-1.0.2/src/worker.c:629:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[MAXLINELEN]; data/gross-1.0.2/src/worker_milter.c:67: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 caddr[INET_ADDRSTRLEN + 1]; data/gross-1.0.2/src/worker_postfix.c:65: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 response[MAXLINELEN] = { '\0' }; data/gross-1.0.2/src/worker_postfix.c:143: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[MAXLINELEN]; data/gross-1.0.2/src/worker_sjsms.c:60: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[MAXLINELEN] = { '\0' }; data/gross-1.0.2/src/worker_sjsms.c:64: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 mapreason[MAXLINELEN] = { '\0' }; data/gross-1.0.2/src/worker_sjsms.c:173: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 response[MAXLINELEN]; data/gross-1.0.2/src/worker_sjsms.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(msg, client_info->message, client_info->msglen); data/gross-1.0.2/src/worker_sjsms.c:274:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(str, msg->message, MIN(msg->msglen, MAXLINELEN)); data/gross-1.0.2/src/worker_sjsms.c:304: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 mesg[MAXLINELEN]; data/gross-1.0.2/src/worker_sjsms.c:343: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(client_info->message, mesg, msglen); data/gross-1.0.2/src/check_blocker.c:73: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). ret = writen(blocker, buffer, strlen(buffer)); data/gross-1.0.2/src/check_dnsbl.c:162:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((iplen = strlen(ipstr)) > INET_ADDRSTRLEN) { data/gross-1.0.2/src/check_dnsbl.c:200: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). assert(strlen(tmpstr) == iplen); data/gross-1.0.2/src/check_dnsbl.c:201:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ipstr, tmpstr, iplen); data/gross-1.0.2/src/check_dnsbl.c:263: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(qstr) > INET_ADDRSTRLEN - 1) { data/gross-1.0.2/src/check_dnsbl.c:278: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). ptr = sender + strlen(sender); /* end of the address */ data/gross-1.0.2/src/check_dnsbl.c:308: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). *(dnsbl->name + strlen(dnsbl->name) - 1) != '.' ? "." : ""); data/gross-1.0.2/src/client_postfix.c:88: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). writen(fd, mbuf, strlen(mbuf)); data/gross-1.0.2/src/client_postfix.c:97: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(line) > 0) data/gross-1.0.2/src/client_postfix.c:105: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). } while (strlen(line) > 0); data/gross-1.0.2/src/conf.c:338:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(line, buffer, MAXLINELEN); data/gross-1.0.2/src/grosscheck.c:98:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, arg, *arglen); data/gross-1.0.2/src/grosscheck.c:136:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(caddr, begin, SBUFLEN - 1); data/gross-1.0.2/src/grosscheck.c:139:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(recipient, begin, SBUFLEN - 1); data/gross-1.0.2/src/grosscheck.c:148:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(sender, "<>", SBUFLEN - 1); data/gross-1.0.2/src/grosscheck.c:150:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sender, begin, SBUFLEN - 1); data/gross-1.0.2/src/grosscheck.c:157:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(helo, begin, SBUFLEN - 1); data/gross-1.0.2/src/grosscheck.c:165:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(helo, "", SBUFLEN - 1); data/gross-1.0.2/src/grosscheck.c:175: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). request = buildquerystr(sender, recipient, caddr, strlen(helo) ? helo : NULL); data/gross-1.0.2/src/grosscheck.c:249:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(res, rstr, MTASTRLEN); data/gross-1.0.2/src/grosscheck.c:250: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). *reslen = strlen(rstr); data/gross-1.0.2/src/grosscheck.c:276: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). foolen = strlen(arg); data/gross-1.0.2/src/msgqueue-test.c:69:4: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(1000); data/gross-1.0.2/src/proto_sjsms.c:49: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). message.msglen = MIN(strlen(message.message) + 1, MAXLINELEN); data/gross-1.0.2/src/proto_sjsms.c:73: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). message.msglen = MIN(strlen(querystr), MAXLINELEN); data/gross-1.0.2/src/sha256-test.c:50:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(message, test->message, MAX_MESSAGE_LEN); data/gross-1.0.2/src/sha256-test.c:51:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(reference_digest, test->reference_digest, MAX_MESSAGE_LEN); data/gross-1.0.2/src/sha256-test.c:56: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). digest = sha256((sha_byte_t *)message, strlen(message)); data/gross-1.0.2/src/sha256.c:222:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return sha256(((sha_byte_t *)message), strlen(message)); data/gross-1.0.2/src/srvstatus.c:65: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). snprintf(buf, len - strlen(buf), "%d: bloommgr-thread is dead.", state); data/gross-1.0.2/src/srvstatus.c:68: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). snprintf(buf, len - strlen(buf), "%d: syncmgr-thread is dead.", state); data/gross-1.0.2/src/srvstatus.c:72: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). snprintf(buf, len - strlen(buf), "%d: sjsms_server-thread is dead.", state); data/gross-1.0.2/src/srvstatus.c:76: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). snprintf(buf, len - strlen(buf), "%d: postfix_server-thread is dead.", state); data/gross-1.0.2/src/srvstatus.c:79: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). snprintf(buf, len - strlen(buf), "%d: Rotate stuck.", state); data/gross-1.0.2/src/srvstatus.c:82: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). snprintf(buf, len - strlen(buf), "%d: Update queue length %d (In: %d + Out: %d).", state, data/gross-1.0.2/src/srvstatus.c:86: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). snprintf(buf, len - strlen(buf), "%d: Update queue length %d (In: %d + Out: %d).", state, data/gross-1.0.2/src/srvstatus.c:90: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). snprintf(buf, len - strlen(buf), "%d: Peer unreachable.", state); data/gross-1.0.2/src/srvstatus.c:93: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). snprintf(buf, len - strlen(buf), "%d: Grossd OK. Update queue: %d (In: %d + Out: %d)", data/gross-1.0.2/src/srvstatus.c:96: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). snprintf(buf + strlen(buf), len - strlen(buf), data/gross-1.0.2/src/srvstatus.c:96:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(buf + strlen(buf), len - strlen(buf), data/gross-1.0.2/src/srvstatus.c:102: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). snprintf(buf + strlen(buf), len - strlen(buf), " Dnsbl matches: "); data/gross-1.0.2/src/srvstatus.c:102:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(buf + strlen(buf), len - strlen(buf), " Dnsbl matches: "); data/gross-1.0.2/src/srvstatus.c:103: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). dnsbl_stats(buf + strlen(buf), len - strlen(buf)); data/gross-1.0.2/src/srvstatus.c:103: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). dnsbl_stats(buf + strlen(buf), len - strlen(buf)); data/gross-1.0.2/src/srvstatus.c:155: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). statbuf[strlen(statbuf)] = '\n'; data/gross-1.0.2/src/srvstatus.c:158: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). writen(tmpfd, statbuf, strlen(statbuf)); data/gross-1.0.2/src/srvutils.c:135: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). combolen = strlen(reason) + 1 + strlen(errstr) + 1; data/gross-1.0.2/src/srvutils.c:135:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). combolen = strlen(reason) + 1 + strlen(errstr) + 1; data/gross-1.0.2/src/srvutils.c:280: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). if (strncmp(ctx->mmap_info->magic, magic, strlen(magic)) == 0) { data/gross-1.0.2/src/srvutils.c:287:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ctx->mmap_info->magic, magic, 8); data/gross-1.0.2/src/srvutils.c:563:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(msg, buf, len - 1); data/gross-1.0.2/src/srvutils.c:566: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). return strlen(msg); data/gross-1.0.2/src/srvutils.c:594:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(ipstr, "UNKNOWN\0", INET_ADDRSTRLEN); data/gross-1.0.2/src/utils.c:41:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((rc = read(fd, &c, 1)) == 1) { data/gross-1.0.2/src/utils.c:76:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((nread = read(fd, ptr, nleft)) < 0) { data/gross-1.0.2/src/utils.c:127: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). linelen = strlen(line) + strlen(terminator) + 1; data/gross-1.0.2/src/utils.c:127: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). linelen = strlen(line) + strlen(terminator) + 1; data/gross-1.0.2/src/utils.c:169: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(buffer); data/gross-1.0.2/src/utils.c:194:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). end = *buf + strlen(*buf) - 1; data/gross-1.0.2/src/utils.c:198: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). return strlen(*buf); data/gross-1.0.2/src/worker.c:127: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(ipstr) > INET_ADDRSTRLEN) { data/gross-1.0.2/src/worker.c:519: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 (strncmp(matcher, matchee, strlen(matcher)) == 0) data/gross-1.0.2/src/worker.c:521: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). return strdup(matchee + strlen(matcher)); data/gross-1.0.2/src/worker_postfix.c:49:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). epilogue = reasonsubstitute + strlen(REASONTEMPLATE); data/gross-1.0.2/src/worker_postfix.c:158: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). } else if (ret == DATA && strlen(line) == 0 && input == 0) { data/gross-1.0.2/src/worker_postfix.c:197: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). } while (strlen(line) > 0); data/gross-1.0.2/src/worker_sjsms.c:77: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). epilogue = reasonsubstitute + strlen(REASONTEMPLATE); data/gross-1.0.2/src/worker_sjsms.c:190:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(response, "F", MAXLINELEN); data/gross-1.0.2/src/worker_sjsms.c:266:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sendto(client_info->connfd, response, strlen(response), ANALYSIS SUMMARY: Hits = 216 Lines analyzed = 9937 in approximately 0.27 seconds (36673 lines/second) Physical Source Lines of Code (SLOC) = 6994 Hits@level = [0] 181 [1] 69 [2] 130 [3] 7 [4] 5 [5] 5 Hits@level+ = [0+] 397 [1+] 216 [2+] 147 [3+] 17 [4+] 10 [5+] 5 Hits/KSLOC@level+ = [0+] 56.7629 [1+] 30.8836 [2+] 21.018 [3+] 2.43065 [4+] 1.4298 [5+] 0.714898 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.