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/iperf3-3.9/examples/mic.c Examining data/iperf3-3.9/examples/mis.c Examining data/iperf3-3.9/src/cjson.c Examining data/iperf3-3.9/src/cjson.h Examining data/iperf3-3.9/src/dscp.c Examining data/iperf3-3.9/src/flowlabel.h Examining data/iperf3-3.9/src/iperf.h Examining data/iperf3-3.9/src/iperf_api.c Examining data/iperf3-3.9/src/iperf_api.h Examining data/iperf3-3.9/src/iperf_auth.c Examining data/iperf3-3.9/src/iperf_auth.h Examining data/iperf3-3.9/src/iperf_client_api.c Examining data/iperf3-3.9/src/iperf_error.c Examining data/iperf3-3.9/src/iperf_locale.c Examining data/iperf3-3.9/src/iperf_locale.h Examining data/iperf3-3.9/src/iperf_sctp.c Examining data/iperf3-3.9/src/iperf_sctp.h Examining data/iperf3-3.9/src/iperf_server_api.c Examining data/iperf3-3.9/src/iperf_tcp.c Examining data/iperf3-3.9/src/iperf_tcp.h Examining data/iperf3-3.9/src/iperf_time.c Examining data/iperf3-3.9/src/iperf_time.h Examining data/iperf3-3.9/src/iperf_udp.c Examining data/iperf3-3.9/src/iperf_udp.h Examining data/iperf3-3.9/src/iperf_util.c Examining data/iperf3-3.9/src/iperf_util.h Examining data/iperf3-3.9/src/main.c Examining data/iperf3-3.9/src/net.c Examining data/iperf3-3.9/src/net.h Examining data/iperf3-3.9/src/portable_endian.h Examining data/iperf3-3.9/src/queue.h Examining data/iperf3-3.9/src/t_api.c Examining data/iperf3-3.9/src/t_auth.c Examining data/iperf3-3.9/src/t_timer.c Examining data/iperf3-3.9/src/t_units.c Examining data/iperf3-3.9/src/t_uuid.c Examining data/iperf3-3.9/src/tcp_info.c Examining data/iperf3-3.9/src/timer.c Examining data/iperf3-3.9/src/timer.h Examining data/iperf3-3.9/src/units.c Examining data/iperf3-3.9/src/units.h FINAL RESULTS: data/iperf3-3.9/src/cjson.c:417:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(object->valuestring, valuestring); data/iperf3-3.9/src/dscp.c:36:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf _snprintf data/iperf3-3.9/src/dscp.c:36:18: [4] (format) _snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf _snprintf data/iperf3-3.9/src/iperf_api.c:119:5: [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. fprintf(f, usage_longstr, UDP_RATE / (1024*1024), DURATION, DEFAULT_TCP_BLKSIZE / 1024, DEFAULT_UDP_BLKSIZE); data/iperf3-3.9/src/iperf_api.c:3077:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(mbuf, "[%s-%s]", stream_must_be_sender?"TX":"RX", test->role == 'c'?"C":"S"); data/iperf3-3.9/src/iperf_api.c:3255:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(mbuf, "[%s-%s]", stream_must_be_sender?"TX":"RX", test->role == 'c'?"C":"S"); data/iperf3-3.9/src/iperf_api.c:3700:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(mbuf, "[%s-%s]", sp->sender?"TX":"RX", test->role == 'c'?"C":"S"); data/iperf3-3.9/src/iperf_api.c:4355:6: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. r = vfprintf(test->outfile, format, argp); data/iperf3-3.9/src/iperf_api.c:4362:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. i = sprintf(linebuffer, "%s", ct); data/iperf3-3.9/src/iperf_api.c:4365:6: [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. r = vsnprintf(linebuffer + i, sizeof(linebuffer), format, argp); data/iperf3-3.9/src/iperf_api.h:325:91: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. int iperf_printf(struct iperf_test *test, const char *format, ...) __attribute__ ((format(printf,2,3))); data/iperf3-3.9/src/iperf_api.h:329:89: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void iperf_err(struct iperf_test *test, const char *format, ...) __attribute__ ((format(printf,2,3))); data/iperf3-3.9/src/iperf_api.h:330:93: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void iperf_errexit(struct iperf_test *test, const char *format, ...) __attribute__ ((format(printf,2,3),noreturn)); data/iperf3-3.9/src/iperf_auth.c:74:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(salted, "{%s}%s", username, password); data/iperf3-3.9/src/iperf_auth.c:294: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(text, text_len, auth_text_format, username, password, utc_seconds); data/iperf3-3.9/src/iperf_auth.c:334:14: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. int rc = sscanf((char *) plaintext, auth_text_format, s_username, s_password, ts); data/iperf3-3.9/src/iperf_error.c:59:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(str, sizeof(str), format, argp); data/iperf3-3.9/src/iperf_error.c:97:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(str, sizeof(str), format, argp); data/iperf3-3.9/src/tcp_info.c:201:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(message, report_tcpInfo, r->tcpInfo.tcpi_snd_cwnd, r->tcpInfo.tcpi_snd_ssthresh, data/iperf3-3.9/src/tcp_info.c:207:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(message, report_tcpInfo, r->tcpInfo.tcpi_snd_cwnd, data/iperf3-3.9/src/tcp_info.c:211:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(message, report_tcpInfo, r->tcpInfo.tcpi_snd_cwnd, data/iperf3-3.9/src/units.c:349:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(s, inLen, format, inNum, suffix); data/iperf3-3.9/src/iperf_api.c:956:20: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((flag = getopt_long(argc, argv, "p:f:i:D1VJvsc:ub:t:n:k:l:P:Rw:B:M:N46S:L:ZO:F:A:T:C:dI:hX:", longopts, NULL)) != -1) { data/iperf3-3.9/src/iperf_api.c:1379:32: [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. if ((client_password = getenv("IPERF3_PASSWORD")) != NULL) data/iperf3-3.9/src/iperf_api.c:3835:25: [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* tempdir = getenv("TMPDIR"); data/iperf3-3.9/src/iperf_api.c:3837:23: [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. tempdir = getenv("TEMP"); data/iperf3-3.9/src/iperf_api.c:3840:23: [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. tempdir = getenv("TMP"); data/iperf3-3.9/examples/mic.c:32:12: [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). port = atoi( argv[2] ); data/iperf3-3.9/examples/mis.c:31:12: [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). port = atoi( argv[1] ); data/iperf3-3.9/src/cjson.c:133: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. static char version[15]; data/iperf3-3.9/src/cjson.c:134:5: [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(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); data/iperf3-3.9/src/cjson.c:211: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(copy, string, length); data/iperf3-3.9/src/cjson.c:316:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char number_c_string[64]; data/iperf3-3.9/src/cjson.c:523:13: [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(newbuffer, p->buffer, p->offset + 1); data/iperf3-3.9/src/cjson.c:560:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char number_buffer[26] = {0}; /* temporary buffer to print the number into */ data/iperf3-3.9/src/cjson.c:572:18: [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. length = sprintf((char*)number_buffer, "null"); data/iperf3-3.9/src/cjson.c:577:18: [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. length = sprintf((char*)number_buffer, "%1.15g", d); data/iperf3-3.9/src/cjson.c:583:22: [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. length = sprintf((char*)number_buffer, "%1.17g", d); data/iperf3-3.9/src/cjson.c:929:9: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy((char*)output, "\"\""); data/iperf3-3.9/src/cjson.c:970:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output + 1, input, output_length); data/iperf3-3.9/src/cjson.c:1016:21: [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((char*)output_pointer, "u%04x", *input_pointer); data/iperf3-3.9/src/cjson.c:1233:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(printed, buffer->buffer, cjson_min(buffer->length, buffer->offset + 1)); data/iperf3-3.9/src/cjson.c:1389:13: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy((char*)output, "null"); data/iperf3-3.9/src/cjson.c:1398:13: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy((char*)output, "false"); data/iperf3-3.9/src/cjson.c:1407:13: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy((char*)output, "true"); data/iperf3-3.9/src/cjson.c:1427:13: [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(output, item->valuestring, raw_length); data/iperf3-3.9/src/cjson.c:1946: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(reference, item, sizeof(cJSON)); data/iperf3-3.9/src/dscp.c:149:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char iptos_str[sizeof "0xff"]; data/iperf3-3.9/src/iperf.h:343: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 cookie[COOKIE_SIZE]; data/iperf3-3.9/src/iperf_api.c:788: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 now_str[100]; data/iperf3-3.9/src/iperf_api.c:789: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 ipr[INET6_ADDRSTRLEN]; data/iperf3-3.9/src/iperf_api.c:959:12: [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). portno = atoi(optarg); data/iperf3-3.9/src/iperf_api.c:1056: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). test->settings->burst = atoi(slash); data/iperf3-3.9/src/iperf_api.c:1083: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). test->duration = atoi(optarg); data/iperf3-3.9/src/iperf_api.c:1104:37: [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). test->num_streams = atoi(optarg); data/iperf3-3.9/src/iperf_api.c:1143:12: [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). portno = atoi(optarg); data/iperf3-3.9/src/iperf_api.c:1151: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). test->settings->mss = atoi(optarg); data/iperf3-3.9/src/iperf_api.c:1240:30: [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). test->omit = atoi(optarg); data/iperf3-3.9/src/iperf_api.c:1260: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). test->server_affinity = atoi(comma+1); data/iperf3-3.9/src/iperf_api.c:1493:21: [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). test->outfile = fopen(test->logfile, "a+"); data/iperf3-3.9/src/iperf_api.c:2363: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(irp, new, sizeof(struct iperf_interval_results)); data/iperf3-3.9/src/iperf_api.c:2379: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 ipl[INET6_ADDRSTRLEN], ipr[INET6_ADDRSTRLEN]; data/iperf3-3.9/src/iperf_api.c:2898:13: [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(&temp.interval_start_time, &rp->end_time, sizeof(struct iperf_time)); data/iperf3-3.9/src/iperf_api.c:2900:13: [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(&temp.interval_start_time, &rp->start_time, sizeof(struct iperf_time)); data/iperf3-3.9/src/iperf_api.c:2903:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&temp.interval_end_time, &rp->end_time, sizeof(struct iperf_time)); data/iperf3-3.9/src/iperf_api.c:3060:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ubuf[UNIT_LEN]; data/iperf3-3.9/src/iperf_api.c:3061:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nbuf[UNIT_LEN]; data/iperf3-3.9/src/iperf_api.c:3062:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mbuf[UNIT_LEN]; data/iperf3-3.9/src/iperf_api.c:3236:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ubuf[UNIT_LEN]; data/iperf3-3.9/src/iperf_api.c:3237:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nbuf[UNIT_LEN]; data/iperf3-3.9/src/iperf_api.c:3239:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sbuf[UNIT_LEN]; data/iperf3-3.9/src/iperf_api.c:3248:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mbuf[UNIT_LEN]; data/iperf3-3.9/src/iperf_api.c:3689: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 ubuf[UNIT_LEN]; data/iperf3-3.9/src/iperf_api.c:3690: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 nbuf[UNIT_LEN]; data/iperf3-3.9/src/iperf_api.c:3691: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 cbuf[UNIT_LEN]; data/iperf3-3.9/src/iperf_api.c:3692: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 mbuf[UNIT_LEN]; data/iperf3-3.9/src/iperf_api.c:3830: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 template[1024]; data/iperf3-3.9/src/iperf_api.c:3870:21: [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). sp->buffer_fd = mkstemp(template); data/iperf3-3.9/src/iperf_api.c:3904:20: [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). sp->diskfile_fd = open(test->diskfile_name, sender ? O_RDONLY : (O_WRONLY|O_CREAT|O_TRUNC), S_IRUSR|S_IWUSR); data/iperf3-3.9/src/iperf_api.c:4044: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(sp->buffer, data/iperf3-3.9/src/iperf_api.c:4120:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[8]; data/iperf3-3.9/src/iperf_api.c:4123: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(test->pidfile, O_RDONLY, 0); data/iperf3-3.9/src/iperf_api.c:4129:9: [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). pid = atoi(buf); data/iperf3-3.9/src/iperf_api.c:4151: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(test->pidfile, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR|S_IWUSR); data/iperf3-3.9/src/iperf_api.c:4317: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 iperf_timestr[100]; data/iperf3-3.9/src/iperf_api.c:4359:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char linebuffer[1024]; data/iperf3-3.9/src/iperf_auth.c:50:19: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void sha256(const char *string, char outputBuffer[65]) data/iperf3-3.9/src/iperf_auth.c:50:33: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void sha256(const char *string, char outputBuffer[65]) data/iperf3-3.9/src/iperf_auth.c:52:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash[SHA256_DIGEST_LENGTH]; data/iperf3-3.9/src/iperf_auth.c:60:9: [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(outputBuffer + (i * 2), "%02x", hash[i]); data/iperf3-3.9/src/iperf_auth.c:72:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char passwordHash[65]; data/iperf3-3.9/src/iperf_auth.c:73:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char salted[strlen(username) + strlen(password) + 3]; data/iperf3-3.9/src/iperf_auth.c:80:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/iperf3-3.9/src/iperf_auth.c:82: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). ptr_file =fopen(filename,"r"); data/iperf3-3.9/src/iperf_client_api.c:85: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 ca[TCP_CA_NAME_MAX + 1]; data/iperf3-3.9/src/iperf_client_api.c:365:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[128]; data/iperf3-3.9/src/iperf_client_api.c:412: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 str[128]; data/iperf3-3.9/src/iperf_client_api.c:488: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(&read_set, &test->read_set, sizeof(fd_set)); data/iperf3-3.9/src/iperf_client_api.c:489: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(&write_set, &test->write_set, sizeof(fd_set)); data/iperf3-3.9/src/iperf_error.c:38: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 iperf_timestrerr[100]; data/iperf3-3.9/src/iperf_error.c:45: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 str[1000]; data/iperf3-3.9/src/iperf_error.c:83: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 str[1000]; data/iperf3-3.9/src/iperf_error.c:125: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. static char errstr[256]; data/iperf3-3.9/src/iperf_sctp.c:121: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 cookie[COOKIE_SIZE]; data/iperf3-3.9/src/iperf_sctp.c:164: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 portstr[6]; data/iperf3-3.9/src/iperf_sctp.c:286: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 portstr[6]; data/iperf3-3.9/src/iperf_sctp.c:557: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 portstr[6]; data/iperf3-3.9/src/iperf_sctp.c:670:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(bp, ai->ai_addr, ai->ai_addrlen); data/iperf3-3.9/src/iperf_server_api.c:456:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&read_set, &test->read_set, sizeof(fd_set)); data/iperf3-3.9/src/iperf_server_api.c:457:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&write_set, &test->write_set, sizeof(fd_set)); data/iperf3-3.9/src/iperf_server_api.c:534: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 ca[TCP_CA_NAME_MAX + 1]; data/iperf3-3.9/src/iperf_tcp.c:115: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 cookie[COOKIE_SIZE]; data/iperf3-3.9/src/iperf_tcp.c:167:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char portstr[6]; data/iperf3-3.9/src/iperf_tcp.c:369: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 portstr[6]; data/iperf3-3.9/src/iperf_tcp.c:559:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char freq_buf[sizeof(struct in6_flowlabel_req)]; data/iperf3-3.9/src/iperf_tcp.c:568:13: [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(&freq->flr_dst, &sa6P->sin6_addr, 16); data/iperf3-3.9/src/iperf_udp.c:232: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(sp->buffer, &sec, sizeof(sec)); data/iperf3-3.9/src/iperf_udp.c:233: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(sp->buffer+4, &usec, sizeof(usec)); data/iperf3-3.9/src/iperf_udp.c:234: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(sp->buffer+8, &pcount, sizeof(pcount)); data/iperf3-3.9/src/iperf_udp.c:245: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(sp->buffer, &sec, sizeof(sec)); data/iperf3-3.9/src/iperf_udp.c:246: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(sp->buffer+4, &usec, sizeof(usec)); data/iperf3-3.9/src/iperf_udp.c:247: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(sp->buffer+8, &pcount, sizeof(pcount)); data/iperf3-3.9/src/iperf_udp.c:320:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[80]; data/iperf3-3.9/src/iperf_udp.c:342:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[80]; data/iperf3-3.9/src/iperf_util.c:66:19: [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). frandom = fopen(rndfile, "rb"); data/iperf3-3.9/src/iperf_util.c:229: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. static char buf[1024]; data/iperf3-3.9/src/iperf_util.c:245: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. static char features[1024]; data/iperf3-3.9/src/iperf_util.c:352: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 name[100]; data/iperf3-3.9/src/iperf_util.c:474:27: [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 (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) { data/iperf3-3.9/src/net.c:224: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 portstr[6]; data/iperf3-3.9/src/t_auth.c:53:23: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void sha256(const char *string, char outputBuffer[65]); data/iperf3-3.9/src/t_auth.c:53:37: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void sha256(const char *string, char outputBuffer[65]); data/iperf3-3.9/src/t_auth.c:56: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 sha256Output[65]; data/iperf3-3.9/src/t_units.c:42: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 s[11]; data/iperf3-3.9/src/t_uuid.c:37:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cookie[37]; data/iperf3-3.9/examples/mic.c:59:3: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(iperf_get_test_json_output_string(test))); data/iperf3-3.9/src/cjson.c:205: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). length = strlen((const char*)string) + sizeof(""); data/iperf3-3.9/src/cjson.c:415:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(valuestring) <= strlen(object->valuestring)) data/iperf3-3.9/src/cjson.c:415: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 (strlen(valuestring) <= strlen(object->valuestring)) data/iperf3-3.9/src/cjson.c:543: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). buffer->offset += strlen((const char*)buffer_pointer); data/iperf3-3.9/src/cjson.c:1094: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). buffer_length = strlen(value) + sizeof(""); data/iperf3-3.9/src/cjson.c:1421: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). raw_length = strlen(item->valuestring) + sizeof(""); data/iperf3-3.9/src/iperf_api.c:776: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). prefix_len = strlen(prefix); data/iperf3-3.9/src/iperf_api.c:778: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). int str_len = strlen(str); data/iperf3-3.9/src/iperf_api.c:2062: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). buflen += strlen(t->line); data/iperf3-3.9/src/iperf_api.c:2068:7: [1] (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. strncat(output, t->line, buflen); data/iperf3-3.9/src/iperf_api.c:2069: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). buflen -= strlen(t->line); data/iperf3-3.9/src/iperf_api.c:2298: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). hsize = strlen(str); data/iperf3-3.9/src/iperf_api.c:4016:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(sp->diskfile_fd, sp->buffer, sp->test->settings->blksize - data/iperf3-3.9/src/iperf_api.c:4125:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, sizeof(buf) - 1) >= 0) { data/iperf3-3.9/src/iperf_api.c:4156:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (write(fd, buf, strlen(buf) + 1) < 0) { data/iperf3-3.9/src/iperf_auth.c:55: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). SHA256_Update(&sha256, string, strlen(string)); data/iperf3-3.9/src/iperf_auth.c:73: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). char salted[strlen(username) + strlen(password) + 3]; data/iperf3-3.9/src/iperf_auth.c:73: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 salted[strlen(username) + strlen(password) + 3]; data/iperf3-3.9/src/iperf_auth.c:95: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). if (strlen(buf) == 0 || strchr(buf, ',') == NULL || buf[0] == '#'){ data/iperf3-3.9/src/iperf_auth.c:129: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). size_t len = strlen(b64input), padding = 0; data/iperf3-3.9/src/iperf_auth.c:150: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). *length = BIO_read(bio, *buffer, strlen(b64message)); data/iperf3-3.9/src/iperf_auth.c:238:61: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). BIO *bioBuff = BIO_new_mem_buf((void*)plaintext, (int)strlen(plaintext)); data/iperf3-3.9/src/iperf_auth.c:289: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). const int text_len = strlen(auth_text_format) + strlen(username) + strlen(password) + 32; data/iperf3-3.9/src/iperf_auth.c:289:53: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const int text_len = strlen(auth_text_format) + strlen(username) + strlen(password) + 32; data/iperf3-3.9/src/iperf_auth.c:289:72: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const int text_len = strlen(auth_text_format) + strlen(username) + strlen(password) + 32; data/iperf3-3.9/src/iperf_client_api.c:75:68: [1] (buffer) strlen: Does not handle 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 (setsockopt(s, IPPROTO_TCP, TCP_CONGESTION, test->congestion, strlen(test->congestion)) < 0) { data/iperf3-3.9/src/iperf_client_api.c:237:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((rval = read(test->ctrl_sck, (char*) &test->state, sizeof(signed char))) <= 0) { data/iperf3-3.9/src/iperf_error.c:435:9: [1] (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 low because the source is a constant string. strncat(errstr, ": ", len - strlen(errstr) - 1); data/iperf3-3.9/src/iperf_error.c:435: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). strncat(errstr, ": ", len - strlen(errstr) - 1); data/iperf3-3.9/src/iperf_error.c:437:9: [1] (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. strncat(errstr, strerror(errno), len - strlen(errstr) - 1); data/iperf3-3.9/src/iperf_error.c:437: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). strncat(errstr, strerror(errno), len - strlen(errstr) - 1); data/iperf3-3.9/src/iperf_error.c:439:9: [1] (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. strncat(errstr, gai_strerror(gerror), len - strlen(errstr) - 1); data/iperf3-3.9/src/iperf_error.c:439:53: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(errstr, gai_strerror(gerror), len - strlen(errstr) - 1); data/iperf3-3.9/src/iperf_server_api.c:509:73: [1] (buffer) strlen: Does not handle 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 (setsockopt(s, IPPROTO_TCP, TCP_CONGESTION, test->congestion, strlen(test->congestion)) < 0) { data/iperf3-3.9/src/iperf_util.c:252:2: [1] (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 low because the source is a constant string. strncat(features, ", ", data/iperf3-3.9/src/iperf_util.c:253: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:255:5: [1] (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 low because the source is a constant string. strncat(features, "CPU affinity setting", data/iperf3-3.9/src/iperf_util.c:256: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:262:2: [1] (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 low because the source is a constant string. strncat(features, ", ", data/iperf3-3.9/src/iperf_util.c:263: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:265:5: [1] (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 low because the source is a constant string. strncat(features, "IPv6 flow label", data/iperf3-3.9/src/iperf_util.c:266: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:272:2: [1] (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 low because the source is a constant string. strncat(features, ", ", data/iperf3-3.9/src/iperf_util.c:273: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:275:5: [1] (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 low because the source is a constant string. strncat(features, "SCTP", data/iperf3-3.9/src/iperf_util.c:276: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:282:2: [1] (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 low because the source is a constant string. strncat(features, ", ", data/iperf3-3.9/src/iperf_util.c:283: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:285:5: [1] (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 low because the source is a constant string. strncat(features, "TCP congestion algorithm setting", data/iperf3-3.9/src/iperf_util.c:286: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:292:2: [1] (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 low because the source is a constant string. strncat(features, ", ", data/iperf3-3.9/src/iperf_util.c:293: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:295:5: [1] (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 low because the source is a constant string. strncat(features, "sendfile / zerocopy", data/iperf3-3.9/src/iperf_util.c:296: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:302:2: [1] (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 low because the source is a constant string. strncat(features, ", ", data/iperf3-3.9/src/iperf_util.c:303: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:305:5: [1] (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 low because the source is a constant string. strncat(features, "socket pacing", data/iperf3-3.9/src/iperf_util.c:306: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:312:2: [1] (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 low because the source is a constant string. strncat(features, ", ", data/iperf3-3.9/src/iperf_util.c:313: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:315:5: [1] (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 low because the source is a constant string. strncat(features, "authentication", data/iperf3-3.9/src/iperf_util.c:316: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:321:2: [1] (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 low because the source is a constant string. strncat(features, "None", data/iperf3-3.9/src/iperf_util.c:322: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). sizeof(features) - strlen(features) - 1); data/iperf3-3.9/src/iperf_util.c:531:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = fgetc(fp); data/iperf3-3.9/src/net.c:326:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(fd, buf, nleft); data/iperf3-3.9/src/t_auth.c:70:57: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert(Base64Encode((unsigned char *) base64String, strlen(base64String), &base64Text) == 0); data/iperf3-3.9/src/t_uuid.c:40:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(cookie) != 36) ANALYSIS SUMMARY: Hits = 204 Lines analyzed = 17547 in approximately 0.53 seconds (33113 lines/second) Physical Source Lines of Code (SLOC) = 12792 Hits@level = [0] 187 [1] 69 [2] 108 [3] 5 [4] 22 [5] 0 Hits@level+ = [0+] 391 [1+] 204 [2+] 135 [3+] 27 [4+] 22 [5+] 0 Hits/KSLOC@level+ = [0+] 30.566 [1+] 15.9475 [2+] 10.5535 [3+] 2.11069 [4+] 1.71982 [5+] 0 Dot directories skipped = 2 (--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.