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/carbon-c-relay-3.7/aggregator.c Examining data/carbon-c-relay-3.7/aggregator.h Examining data/carbon-c-relay-3.7/allocator.c Examining data/carbon-c-relay-3.7/allocator.h Examining data/carbon-c-relay-3.7/collector.c Examining data/carbon-c-relay-3.7/collector.h Examining data/carbon-c-relay-3.7/conffile.h Examining data/carbon-c-relay-3.7/conffile.tab.c Examining data/carbon-c-relay-3.7/conffile.tab.h Examining data/carbon-c-relay-3.7/conffile.yy.c Examining data/carbon-c-relay-3.7/consistent-hash.c Examining data/carbon-c-relay-3.7/consistent-hash.h Examining data/carbon-c-relay-3.7/dispatcher.c Examining data/carbon-c-relay-3.7/dispatcher.h Examining data/carbon-c-relay-3.7/faketime.c Examining data/carbon-c-relay-3.7/fnv1a.h Examining data/carbon-c-relay-3.7/issues/distributiontest.c Examining data/carbon-c-relay-3.7/issues/routertest.c Examining data/carbon-c-relay-3.7/md5.c Examining data/carbon-c-relay-3.7/md5.h Examining data/carbon-c-relay-3.7/posixregex.h Examining data/carbon-c-relay-3.7/queue.c Examining data/carbon-c-relay-3.7/queue.h Examining data/carbon-c-relay-3.7/receptor.c Examining data/carbon-c-relay-3.7/receptor.h Examining data/carbon-c-relay-3.7/relay.c Examining data/carbon-c-relay-3.7/relay.h Examining data/carbon-c-relay-3.7/router.c Examining data/carbon-c-relay-3.7/router.h Examining data/carbon-c-relay-3.7/sendmetric.c Examining data/carbon-c-relay-3.7/server.c Examining data/carbon-c-relay-3.7/server.h FINAL RESULTS: data/carbon-c-relay-3.7/conffile.tab.c:1032:21: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define YYFPRINTF fprintf data/carbon-c-relay-3.7/relay.c:127:8: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. ret = vfprintf(dst, fmt, ap); data/carbon-c-relay-3.7/relay.c:800: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(msg, sizeof(msg), __VA_ARGS__); \ data/carbon-c-relay-3.7/relay.h:37:46: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define tracef(...) if (mode & MODE_TRACE) { fprintf(stdout, __VA_ARGS__); fflush(stdout); } data/carbon-c-relay-3.7/router.c:979: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(stubname, sizeof(stubname), data/carbon-c-relay-3.7/router.c:982: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(stubname, sizeof(stubname), data/carbon-c-relay-3.7/router.c:2038:5: [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(stubname, sizeof(stubname), data/carbon-c-relay-3.7/router.c:2245:6: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. f = popen(buf, "r"); data/carbon-c-relay-3.7/router.c:3130: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. stublen = snprintf(x, 32, data/carbon-c-relay-3.7/relay.c:448:15: [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 ((ch = getopt(argc, argv, data/carbon-c-relay-3.7/relay.c:644: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/carbon-c-relay-3.7/router.c:2194:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *tmp = getenv("TMPDIR"); data/carbon-c-relay-3.7/aggregator.c:134:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char newmetric[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/aggregator.c:161:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char newmetric[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/aggregator.c:376:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char metric[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/allocator.c:120: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(m, s, sz); data/carbon-c-relay-3.7/collector.c:62:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char destbuf[1024]; /* sort of POSIX_MAX_PATH */ data/carbon-c-relay-3.7/collector.c:70:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char metric[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/collector.c:94: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(mtrc + sizeof(len), metric, len); \ data/carbon-c-relay-3.7/conffile.tab.c:1327: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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; data/carbon-c-relay-3.7/conffile.tab.c:1543: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 yymsgbuf[128]; data/carbon-c-relay-3.7/conffile.tab.c:3008:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char bcip[24]; data/carbon-c-relay-3.7/conffile.yy.c:1359:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char string_buf[1024]; data/carbon-c-relay-3.7/conffile.yy.c:1820:8: [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). atoi(yytext + strlen("percentile")); data/carbon-c-relay-3.7/conffile.yy.c:2151: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). yylval_param->crINTVAL = atoi(yytext); data/carbon-c-relay-3.7/consistent-hash.c:60: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 md5[MD5_DIGEST_LENGTH]; data/carbon-c-relay-3.7/consistent-hash.c:246:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/carbon-c-relay-3.7/consistent-hash.c:436:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char srvbuf[21]; data/carbon-c-relay-3.7/dispatcher.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 ibuf[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/dispatcher.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 srcaddr[24]; /* string representation of source address */ data/carbon-c-relay-3.7/dispatcher.c:100:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/dispatcher.c:107:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char metric[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/issues/distributiontest.c:55:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/issues/distributiontest.c:70:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(argv[1], "r"); data/carbon-c-relay-3.7/issues/distributiontest.c:80: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 ip[24]; data/carbon-c-relay-3.7/issues/distributiontest.c:81: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 md5[MD5_DIGEST_LENGTH]; data/carbon-c-relay-3.7/issues/distributiontest.c:82: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 md5sum[MD5_DIGEST_LENGTH * 2 + 1]; data/carbon-c-relay-3.7/issues/routertest.c:60: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. free((char *)dests[i].metric); data/carbon-c-relay-3.7/md5.c:227:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ctx->buffer[used], data, size); data/carbon-c-relay-3.7/md5.c:231:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ctx->buffer[used], data, available); data/carbon-c-relay-3.7/md5.c:242:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ctx->buffer, data, size); data/carbon-c-relay-3.7/md5.h:39:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[64]; data/carbon-c-relay-3.7/receptor.c:46:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char saddr[INET6_ADDRSTRLEN]; data/carbon-c-relay-3.7/relay.c:49:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char relay_hostname[256]; data/carbon-c-relay-3.7/relay.c:87:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char prefix[64]; data/carbon-c-relay-3.7/relay.c:157:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((newfd = fopen(relay_logfile, "a")) == NULL) { data/carbon-c-relay-3.7/relay.c:483:34: [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). listenport = (unsigned short)atoi(optarg); data/carbon-c-relay-3.7/relay.c:490:23: [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). workercnt = (char)atoi(optarg); data/carbon-c-relay-3.7/relay.c:497:17: [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). batchsize = atoi(optarg); data/carbon-c-relay-3.7/relay.c:504:17: [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). queuesize = atoi(optarg); data/carbon-c-relay-3.7/relay.c:511:17: [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). maxstalls = atoi(optarg); data/carbon-c-relay-3.7/relay.c:526: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). int val = atoi(optarg); data/carbon-c-relay-3.7/relay.c:545: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). int val = atoi(optarg); data/carbon-c-relay-3.7/relay.c:554: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). int val = atoi(optarg); data/carbon-c-relay-3.7/relay.c:571: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). int val = atoi(optarg); data/carbon-c-relay-3.7/relay.c:579: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). int val = atoi(optarg); data/carbon-c-relay-3.7/relay.c:621: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). int val = atoi(optarg); data/carbon-c-relay-3.7/relay.c:672:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *f = fopen(relay_logfile, "a"); data/carbon-c-relay-3.7/relay.c:705:20: [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). pidfile_handle = fopen(pidfile, "w"); data/carbon-c-relay-3.7/relay.c:743:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[1024]; data/carbon-c-relay-3.7/relay.c:773:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[1024]; data/carbon-c-relay-3.7/relay.c:799: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 msg[1024]; \ data/carbon-c-relay-3.7/relay.c:906: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 metricbuf[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/router.c:151:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char patbuf[8192]; data/carbon-c-relay-3.7/router.c:256:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char serverip_server[256]; /* RFC1035 = 250 */ data/carbon-c-relay-3.7/router.c:288:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf1[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/router.c:289:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf2[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/router.c:291:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char (*sa)[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/router.c:292:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char (*sb)[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/router.c:293:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char (*st)[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/router.c:404:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sport[8]; data/carbon-c-relay-3.7/router.c:420:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char errbuf[40]; data/carbon-c-relay-3.7/router.c:457:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char errmsg[512]; data/carbon-c-relay-3.7/router.c:472: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(*rethint, &hint, sizeof(hint)); data/carbon-c-relay-3.7/router.c:495:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((probefd = open(path, data/carbon-c-relay-3.7/router.c:499: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 errbuf[512]; data/carbon-c-relay-3.7/router.c:544:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ebuf[512]; data/carbon-c-relay-3.7/router.c:600:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hnbuf[INET6_ADDRSTRLEN]; data/carbon-c-relay-3.7/router.c:601:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char errbuf[512]; data/carbon-c-relay-3.7/router.c:867: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 errbuf[512]; data/carbon-c-relay-3.7/router.c:946:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char stubname[48]; data/carbon-c-relay-3.7/router.c:1031: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 msg[256]; data/carbon-c-relay-3.7/router.c:1040: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 hnbufl[INET6_ADDRSTRLEN]; data/carbon-c-relay-3.7/router.c:1041: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 hnbufr[INET6_ADDRSTRLEN]; data/carbon-c-relay-3.7/router.c:1064:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[256]; data/carbon-c-relay-3.7/router.c:1075:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[256]; data/carbon-c-relay-3.7/router.c:1100: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(&(lwalk->pemmtimespec), &(st.st_mtime), data/carbon-c-relay-3.7/router.c:1290:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((cnf = fopen(path, "r")) == NULL) { data/carbon-c-relay-3.7/router.c:1360:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sockbuf[128]; data/carbon-c-relay-3.7/router.c:1419:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pblock[64]; data/carbon-c-relay-3.7/router.c:1782: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 cprefix[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/router.c:2029:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char stubname[48]; data/carbon-c-relay-3.7/router.c:2030:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char percentile[16]; data/carbon-c-relay-3.7/router.c:2097:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char blockname[64]; data/carbon-c-relay-3.7/router.c:2195:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char patho[512]; data/carbon-c-relay-3.7/router.c:2196:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pathn[512]; data/carbon-c-relay-3.7/router.c:2197:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[1033]; data/carbon-c-relay-3.7/router.c:2211:7: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp(patho); data/carbon-c-relay-3.7/router.c:2228:7: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp(pathn); data/carbon-c-relay-3.7/router.c:2307:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hnbufl[INET6_ADDRSTRLEN]; data/carbon-c-relay-3.7/router.c:2308:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hnbufr[INET6_ADDRSTRLEN]; data/carbon-c-relay-3.7/router.c:2517: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 (*newmetric)[METRIC_BUFSIZ], data/carbon-c-relay-3.7/router.c:2700:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ts_now[32]; data/carbon-c-relay-3.7/router.c:2741:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char newmetric[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/router.c:2803: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((void *)(RET.metric + sizeof(len)), fmtmetric, len); data/carbon-c-relay-3.7/router.c:2945:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(metric, newmetric, len); data/carbon-c-relay-3.7/router.c:3049:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char newmetric[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/router.c:3124:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char percentile[16]; data/carbon-c-relay-3.7/router.c:3129:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char x[32]; data/carbon-c-relay-3.7/router.c:3205:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(metric, newmetric, len); data/carbon-c-relay-3.7/router.h:82:30: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. size_t router_rewrite_metric(char (*newmetric)[METRIC_BUFSIZ], char **newfirstspace, const char *metric, const char *firstspace, const char *replacement, const size_t nmatch, const regmatch_t *pmatch); data/carbon-c-relay-3.7/sendmetric.c:36:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[8192]; data/carbon-c-relay-3.7/server.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 obuf[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/server.c:168: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(strm->obuf + strm->obuflen, buf, sze); data/carbon-c-relay-3.7/server.c:178:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cbuf[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/server.c:269: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(strm->obuf + strm->obuflen, buf, copysize); data/carbon-c-relay-3.7/server.c:350: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(strm->obuf + strm->obuflen, buf, sze); data/carbon-c-relay-3.7/server.c:360:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cbuf[METRIC_BUFSIZ]; data/carbon-c-relay-3.7/server.c:423:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char _sslerror_buf[256]; data/carbon-c-relay-3.7/server.c:646: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 sport[8]; data/carbon-c-relay-3.7/server.c:674:21: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((self->fd = open(self->ip, data/carbon-c-relay-3.7/aggregator.c:596: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(250 * 1000); /* 250ms */ data/carbon-c-relay-3.7/allocator.c:116:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t sz = strlen(s) + 1; data/carbon-c-relay-3.7/collector.c:90: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). size_t len = strlen(metric); \ data/carbon-c-relay-3.7/conffile.tab.c:1224: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 yystrlen strlen data/carbon-c-relay-3.7/conffile.yy.c:1243:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ data/carbon-c-relay-3.7/conffile.yy.c:1820:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). atoi(yytext + strlen("percentile")); data/carbon-c-relay-3.7/conffile.yy.c:2938: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). return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); data/carbon-c-relay-3.7/consistent-hash.c:272:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). entries[i].pos = carbon_hashpos(buf, buf + strlen(buf)); data/carbon-c-relay-3.7/consistent-hash.c:288: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). entries[i].pos = fnv1a_hashpos(buf, buf + strlen(buf)); data/carbon-c-relay-3.7/dispatcher.c:154:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(strm->hdl.sock, buf, sze); data/carbon-c-relay-3.7/issues/distributiontest.c:96:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). MD5((unsigned char *)ip, strlen(ip), md5); data/carbon-c-relay-3.7/issues/distributiontest.c:118: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). buf + strlen(buf) - 1 data/carbon-c-relay-3.7/issues/routertest.c:56:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). firstspace = metric + strlen(metric); data/carbon-c-relay-3.7/queue.c:28:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t read; data/carbon-c-relay-3.7/queue.c:105:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). free((char *)(q->queue[q->read])); data/carbon-c-relay-3.7/queue.c:187:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). q->queue[q->read] = p; data/carbon-c-relay-3.7/receptor.c:187:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(srvr.sun_path, lsnr->ip, sizeof(srvr.sun_path) - 1); data/carbon-c-relay-3.7/relay.c:97:3: [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((100 + (rand() % 200)) * 1000); /* 100ms - 300ms */ data/carbon-c-relay-3.7/relay.c:164: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((100 + (rand() % 200)) * 1000); /* 100ms - 300ms */ data/carbon-c-relay-3.7/relay.c:205:3: [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((100 + (rand() % 200)) * 1000); /* 100ms - 300ms */ data/carbon-c-relay-3.7/relay.c:283: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((100 + (rand() % 200)) * 1000); /* 100ms - 300ms */ data/carbon-c-relay-3.7/relay.c:751:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (write(fds[1], msg, strlen(msg) + 1) > -2) data/carbon-c-relay-3.7/relay.c:759:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (write(fds[1], msg, strlen(msg) + 1) > -2) data/carbon-c-relay-3.7/relay.c:774:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int len = read(fds[0], msg, sizeof(msg)); data/carbon-c-relay-3.7/relay.c:802:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (write(fds[1], msg, strlen(msg) + 1) > -2) \ data/carbon-c-relay-3.7/relay.c:1052:2: [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(500 * 1000); /* 500ms */ data/carbon-c-relay-3.7/router.c:307: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). dummy = *sa + strlen(*sa); data/carbon-c-relay-3.7/router.c:326: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). dummy = *sa + strlen(*sa); data/carbon-c-relay-3.7/router.c:345: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). dummy = *sa + strlen(*sa); data/carbon-c-relay-3.7/router.c:364: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). dummy = *sa + strlen(*sa); data/carbon-c-relay-3.7/router.c:1487:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). p = rwalk->pattern + strlen(rwalk->pattern); data/carbon-c-relay-3.7/router.c:1554: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(b) < 3) { data/carbon-c-relay-3.7/router.c:1784: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). char *dummy = relay_hostname + strlen(relay_hostname); data/carbon-c-relay-3.7/router.c:1831: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). size_t idlen = strlen(ident); data/carbon-c-relay-3.7/router.c:2075:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). router_quoteident(ac->metric + strlen(stubname))); data/carbon-c-relay-3.7/router.c:2210:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask(S_IWGRP | S_IWOTH); data/carbon-c-relay-3.7/router.c:2212:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(mask); data/carbon-c-relay-3.7/router.c:2227:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask(S_IWGRP | S_IWOTH); data/carbon-c-relay-3.7/router.c:2229:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(mask); data/carbon-c-relay-3.7/router.c:2476: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). pmatch[0].rm_eo = pmatch[0].rm_so + strlen(r->strmatch); data/carbon-c-relay-3.7/router.c:2481: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). t.i = strlen(r->strmatch); data/carbon-c-relay-3.7/router.c:2490: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). t.i = strlen(r->strmatch); data/carbon-c-relay-3.7/router.c:2503: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). pmatch[0].rm_eo = strlen(r->strmatch); data/carbon-c-relay-3.7/router.c:2656:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (s - *newmetric + strlen(firstspace) < sizeof(*newmetric)) data/carbon-c-relay-3.7/router.c:2676: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). *outlen = strlen(in); data/carbon-c-relay-3.7/router.c:2958: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). metric + strlen(w->pattern), data/carbon-c-relay-3.7/router.c:2970:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *lastchr = firstspace + strlen(firstspace) - 1; data/carbon-c-relay-3.7/router.c:3076: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). metric + strlen(w->pattern), data/carbon-c-relay-3.7/router.c:3298:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *lastspc = firstspace + strlen(firstspace); data/carbon-c-relay-3.7/sendmetric.c:52:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(saddr.sun_path, spath, sizeof(saddr.sun_path) - 1); data/carbon-c-relay-3.7/server.c:524: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((200 + (rand() % 100)) * 1000); /* 200ms - 300ms */ data/carbon-c-relay-3.7/server.c:625:5: [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((200 + (rand() % 100)) * 1000); /* 200ms - 300ms */ data/carbon-c-relay-3.7/server.c:630: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((200 + (rand() % 100)) * 1000); /* 200ms - 300ms */ data/carbon-c-relay-3.7/server.c:996:6: [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((50 + (rand() % 150)) * 1000); /* 50ms - 200ms */ data/carbon-c-relay-3.7/server.c:1391:5: [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((200 + (rand() % 100)) * 1000) <= 0); data/carbon-c-relay-3.7/server.c:1404:5: [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((200 + (rand() % 100)) * 1000); ANALYSIS SUMMARY: Hits = 177 Lines analyzed = 18551 in approximately 0.54 seconds (34194 lines/second) Physical Source Lines of Code (SLOC) = 14114 Hits@level = [0] 303 [1] 56 [2] 109 [3] 3 [4] 9 [5] 0 Hits@level+ = [0+] 480 [1+] 177 [2+] 121 [3+] 12 [4+] 9 [5+] 0 Hits/KSLOC@level+ = [0+] 34.0088 [1+] 12.5407 [2+] 8.57305 [3+] 0.85022 [4+] 0.637665 [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.