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/srt-1.4.2/apps/apputil.cpp Examining data/srt-1.4.2/apps/apputil.hpp Examining data/srt-1.4.2/apps/logsupport.cpp Examining data/srt-1.4.2/apps/logsupport.hpp Examining data/srt-1.4.2/apps/logsupport_appdefs.cpp Examining data/srt-1.4.2/apps/socketoptions.cpp Examining data/srt-1.4.2/apps/socketoptions.hpp Examining data/srt-1.4.2/apps/srt-file-transmit.cpp Examining data/srt-1.4.2/apps/srt-live-transmit.cpp Examining data/srt-1.4.2/apps/srt-tunnel.cpp Examining data/srt-1.4.2/apps/transmitbase.hpp Examining data/srt-1.4.2/apps/transmitmedia.cpp Examining data/srt-1.4.2/apps/transmitmedia.hpp Examining data/srt-1.4.2/apps/uriparser.cpp Examining data/srt-1.4.2/apps/uriparser.hpp Examining data/srt-1.4.2/apps/verbose.cpp Examining data/srt-1.4.2/apps/verbose.hpp Examining data/srt-1.4.2/cmake_object_lib_support.c Examining data/srt-1.4.2/common/win/syslog_defs.h Examining data/srt-1.4.2/common/win/unistd.h Examining data/srt-1.4.2/common/win/wintime.h Examining data/srt-1.4.2/common/win_time.cpp Examining data/srt-1.4.2/examples/recvfile.cpp Examining data/srt-1.4.2/examples/recvlive.cpp Examining data/srt-1.4.2/examples/sendfile.cpp Examining data/srt-1.4.2/examples/test-c-client-bonding.c Examining data/srt-1.4.2/examples/test-c-client.c Examining data/srt-1.4.2/examples/test-c-server-bonding.c Examining data/srt-1.4.2/examples/test-c-server.c Examining data/srt-1.4.2/examples/testcapi-connect.c Examining data/srt-1.4.2/haicrypt/cryspr-config.h Examining data/srt-1.4.2/haicrypt/cryspr-gnutls.c Examining data/srt-1.4.2/haicrypt/cryspr-gnutls.h Examining data/srt-1.4.2/haicrypt/cryspr-mbedtls.c Examining data/srt-1.4.2/haicrypt/cryspr-mbedtls.h Examining data/srt-1.4.2/haicrypt/cryspr-openssl.c Examining data/srt-1.4.2/haicrypt/cryspr-openssl.h Examining data/srt-1.4.2/haicrypt/cryspr.c Examining data/srt-1.4.2/haicrypt/cryspr.h Examining data/srt-1.4.2/haicrypt/haicrypt.h Examining data/srt-1.4.2/haicrypt/haicrypt_log.cpp Examining data/srt-1.4.2/haicrypt/haicrypt_log.h Examining data/srt-1.4.2/haicrypt/hcrypt.c Examining data/srt-1.4.2/haicrypt/hcrypt.h Examining data/srt-1.4.2/haicrypt/hcrypt_ctx.h Examining data/srt-1.4.2/haicrypt/hcrypt_ctx_rx.c Examining data/srt-1.4.2/haicrypt/hcrypt_ctx_tx.c Examining data/srt-1.4.2/haicrypt/hcrypt_msg.h Examining data/srt-1.4.2/haicrypt/hcrypt_rx.c Examining data/srt-1.4.2/haicrypt/hcrypt_sa.c Examining data/srt-1.4.2/haicrypt/hcrypt_tx.c Examining data/srt-1.4.2/haicrypt/hcrypt_ut.c Examining data/srt-1.4.2/haicrypt/hcrypt_xpt_srt.c Examining data/srt-1.4.2/srtcore/access_control.h Examining data/srt-1.4.2/srtcore/api.cpp Examining data/srt-1.4.2/srtcore/api.h Examining data/srt-1.4.2/srtcore/buffer.cpp Examining data/srt-1.4.2/srtcore/buffer.h Examining data/srt-1.4.2/srtcore/cache.cpp Examining data/srt-1.4.2/srtcore/cache.h Examining data/srt-1.4.2/srtcore/channel.cpp Examining data/srt-1.4.2/srtcore/channel.h Examining data/srt-1.4.2/srtcore/common.cpp Examining data/srt-1.4.2/srtcore/common.h Examining data/srt-1.4.2/srtcore/congctl.cpp Examining data/srt-1.4.2/srtcore/congctl.h Examining data/srt-1.4.2/srtcore/core.cpp Examining data/srt-1.4.2/srtcore/core.h Examining data/srt-1.4.2/srtcore/crypto.cpp Examining data/srt-1.4.2/srtcore/crypto.h Examining data/srt-1.4.2/srtcore/epoll.cpp Examining data/srt-1.4.2/srtcore/epoll.h Examining data/srt-1.4.2/srtcore/fec.cpp Examining data/srt-1.4.2/srtcore/fec.h Examining data/srt-1.4.2/srtcore/group.cpp Examining data/srt-1.4.2/srtcore/group.h Examining data/srt-1.4.2/srtcore/handshake.cpp Examining data/srt-1.4.2/srtcore/handshake.h Examining data/srt-1.4.2/srtcore/list.cpp Examining data/srt-1.4.2/srtcore/list.h Examining data/srt-1.4.2/srtcore/logger_default.cpp Examining data/srt-1.4.2/srtcore/logger_defs.cpp Examining data/srt-1.4.2/srtcore/logger_defs.h Examining data/srt-1.4.2/srtcore/logging.h Examining data/srt-1.4.2/srtcore/logging_api.h Examining data/srt-1.4.2/srtcore/md5.cpp Examining data/srt-1.4.2/srtcore/md5.h Examining data/srt-1.4.2/srtcore/netinet_any.h Examining data/srt-1.4.2/srtcore/packet.cpp Examining data/srt-1.4.2/srtcore/packet.h Examining data/srt-1.4.2/srtcore/packetfilter.cpp Examining data/srt-1.4.2/srtcore/packetfilter.h Examining data/srt-1.4.2/srtcore/packetfilter_api.h Examining data/srt-1.4.2/srtcore/packetfilter_builtin.h Examining data/srt-1.4.2/srtcore/platform_sys.h Examining data/srt-1.4.2/srtcore/queue.cpp Examining data/srt-1.4.2/srtcore/queue.h Examining data/srt-1.4.2/srtcore/srt.h Examining data/srt-1.4.2/srtcore/srt_c_api.cpp Examining data/srt-1.4.2/srtcore/srt_compat.c Examining data/srt-1.4.2/srtcore/srt_compat.h Examining data/srt-1.4.2/srtcore/sync.cpp Examining data/srt-1.4.2/srtcore/sync.h Examining data/srt-1.4.2/srtcore/sync_cxx11.cpp Examining data/srt-1.4.2/srtcore/sync_posix.cpp Examining data/srt-1.4.2/srtcore/threadname.h Examining data/srt-1.4.2/srtcore/udt.h Examining data/srt-1.4.2/srtcore/utilities.h Examining data/srt-1.4.2/srtcore/window.cpp Examining data/srt-1.4.2/srtcore/window.h Examining data/srt-1.4.2/test/test_buffer.cpp Examining data/srt-1.4.2/test/test_connection_timeout.cpp Examining data/srt-1.4.2/test/test_cryspr.cpp Examining data/srt-1.4.2/test/test_enforced_encryption.cpp Examining data/srt-1.4.2/test/test_epoll.cpp Examining data/srt-1.4.2/test/test_fec_rebuilding.cpp Examining data/srt-1.4.2/test/test_file_transmission.cpp Examining data/srt-1.4.2/test/test_list.cpp Examining data/srt-1.4.2/test/test_listen_callback.cpp Examining data/srt-1.4.2/test/test_many_connections.cpp Examining data/srt-1.4.2/test/test_muxer.cpp Examining data/srt-1.4.2/test/test_seqno.cpp Examining data/srt-1.4.2/test/test_socket_options.cpp Examining data/srt-1.4.2/test/test_sync.cpp Examining data/srt-1.4.2/test/test_timer.cpp Examining data/srt-1.4.2/test/test_unitqueue.cpp Examining data/srt-1.4.2/test/test_utilities.cpp Examining data/srt-1.4.2/testing/srt-test-file.cpp Examining data/srt-1.4.2/testing/srt-test-live.cpp Examining data/srt-1.4.2/testing/srt-test-mpbond.cpp Examining data/srt-1.4.2/testing/srt-test-multiplex.cpp Examining data/srt-1.4.2/testing/srt-test-relay.cpp Examining data/srt-1.4.2/testing/testmedia.cpp Examining data/srt-1.4.2/testing/testmedia.hpp Examining data/srt-1.4.2/testing/testmediabase.hpp Examining data/srt-1.4.2/testing/utility-test.cpp FINAL RESULTS: data/srt-1.4.2/apps/srt-live-transmit.cpp:868: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/srt-1.4.2/apps/srt-live-transmit.cpp:868: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/srt-1.4.2/apps/srt-tunnel.cpp:97:11: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. mutex access; // For closing data/srt-1.4.2/apps/srt-tunnel.cpp:280:11: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. mutex access; data/srt-1.4.2/apps/srt-tunnel.cpp:431:30: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. lock_guard<mutex> lk(access); data/srt-1.4.2/apps/srt-tunnel.cpp:515:30: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. lock_guard<mutex> lk(access); data/srt-1.4.2/apps/srt-tunnel.cpp:939:11: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. mutex access; data/srt-1.4.2/apps/srt-tunnel.cpp:946:30: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. lock_guard<mutex> lk(access); data/srt-1.4.2/apps/srt-tunnel.cpp:952:30: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. lock_guard<mutex> lk(access); data/srt-1.4.2/apps/srt-tunnel.cpp:977:31: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. unique_lock<mutex> lk(access); data/srt-1.4.2/apps/srt-tunnel.cpp:1012:26: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. lock_guard<mutex> lk(access); data/srt-1.4.2/apps/srt-tunnel.cpp:1022:26: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. lock_guard<mutex> lk(access); data/srt-1.4.2/common/win/unistd.h:25:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. #define access _access data/srt-1.4.2/srtcore/common.h:1147:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. bool access(int position, Value*& w_v) data/srt-1.4.2/srtcore/common.h:1164:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. bool access(int position, Value*& w_v, bool& w_isnew) data/srt-1.4.2/srtcore/common.h:1235:14: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(position, (pval), (isnew))) data/srt-1.4.2/srtcore/common.h:1248:14: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(position, (pval), (isnew))) data/srt-1.4.2/srtcore/core.cpp:1140: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(((char*)optval), m_BindToDevice.c_str()); data/srt-1.4.2/srtcore/core.cpp:1252: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((char *)optval, m_sStreamName.c_str()); data/srt-1.4.2/srtcore/core.cpp:1259: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((char *)optval, tt.c_str()); data/srt-1.4.2/srtcore/core.cpp:1305: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((char *)optval, m_OPT_PktFilterConfigString.c_str()); data/srt-1.4.2/srtcore/logging.h:40:43: [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. #define PRINTF_LIKE __attribute__((format(printf,2,3))) data/srt-1.4.2/srtcore/logging.h:162: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(prefix, your_pfx); data/srt-1.4.2/srtcore/logging.h:169:13: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(prefix, logger_pfx); data/srt-1.4.2/srtcore/logging.h:348:9: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(buf, fmts, ap); data/srt-1.4.2/testing/srt-test-live.cpp:1017: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/srt-1.4.2/testing/srt-test-live.cpp:1017: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/srt-1.4.2/common/win/unistd.h:15:9: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define srandom srand data/srt-1.4.2/common/win/unistd.h:15:17: [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. #define srandom srand data/srt-1.4.2/common/win/unistd.h:16:9: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. #define random rand data/srt-1.4.2/srtcore/api.cpp:199:4: [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((unsigned int)t.tv_usec); data/srt-1.4.2/srtcore/channel.cpp:593:13: [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(tv.tv_usec & 0xFFFF); data/srt-1.4.2/srtcore/congctl.cpp:529:13: [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(m_iLastDecSeq); data/srt-1.4.2/srtcore/core.h:447:9: [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(count_microseconds(steady_clock::now().time_since_epoch())); data/srt-1.4.2/test/test_file_transmission.cpp:60:9: [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(0)); data/srt-1.4.2/test/test_many_connections.cpp:79:9: [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(randseed); data/srt-1.4.2/apps/apputil.cpp:45: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 srcCopy[INET6_ADDRSTRLEN + 1]; data/srt-1.4.2/apps/srt-file-transmit.cpp:260: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 tmppath[s_max_path]; data/srt-1.4.2/apps/srt-file-transmit.cpp:584:23: [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). ofile.open(directory.c_str(), ios::out | ios::trunc | ios::binary); data/srt-1.4.2/apps/srt-file-transmit.cpp:703:24: [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). logfile_stream.open(cfg.logfile.c_str()); data/srt-1.4.2/apps/srt-file-transmit.cpp:720:23: [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). logfile_stats.open(cfg.stats_out.c_str()); data/srt-1.4.2/apps/srt-live-transmit.cpp:424:24: [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). logfile_stream.open(cfg.logfile.c_str()); data/srt-1.4.2/apps/srt-live-transmit.cpp:442:23: [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). logfile_stats.open(cfg.stats_out.c_str()); data/srt-1.4.2/apps/srt-live-transmit.cpp:854: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 prefix[100] = ""; data/srt-1.4.2/apps/srt-live-transmit.cpp:859: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/srt-1.4.2/apps/srt-tunnel.cpp:549: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 rbuf[1024]; data/srt-1.4.2/apps/transmitmedia.cpp:940: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 buf[512]; data/srt-1.4.2/apps/transmitmedia.cpp:1099: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). iport = atoi(u.port().c_str()); data/srt-1.4.2/apps/transmitmedia.cpp:1110: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). iport = atoi(u.port().c_str()); data/srt-1.4.2/apps/uriparser.cpp:127: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). int i = atoi(m_port.c_str()); data/srt-1.4.2/examples/recvfile.cpp:18:29: [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). if ((argc != 5) || (0 == atoi(argv[2]))) data/srt-1.4.2/examples/recvlive.cpp:20:44: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((2 < argc) || ((2 == argc) && (0 == atoi(argv[1])))) data/srt-1.4.2/examples/recvlive.cpp:118: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 data[1500]; data/srt-1.4.2/examples/recvlive.cpp:153: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 clienthost[NI_MAXHOST]; data/srt-1.4.2/examples/recvlive.cpp:154: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 clientservice[NI_MAXSERV]; data/srt-1.4.2/examples/sendfile.cpp:25:44: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((2 < argc) || ((2 == argc) && (0 == atoi(argv[1])))) data/srt-1.4.2/examples/sendfile.cpp:97: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 clienthost[NI_MAXHOST]; data/srt-1.4.2/examples/sendfile.cpp:98: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 clientservice[NI_MAXSERV]; data/srt-1.4.2/examples/sendfile.cpp:129: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 file[1024]; data/srt-1.4.2/examples/test-c-client-bonding.c:94:29: [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). sa.sin_port = htons(atoi(argv[B + 2*i + 1])); data/srt-1.4.2/examples/test-c-client.c:55:25: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). sa.sin_port = htons(atoi(argv[2])); data/srt-1.4.2/examples/test-c-server-bonding.c:66:25: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). sa.sin_port = htons(atoi(argv[2])); data/srt-1.4.2/examples/test-c-server-bonding.c:116: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 msg[2048]; data/srt-1.4.2/examples/test-c-server.c:50:25: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). sa.sin_port = htons(atoi(argv[2])); data/srt-1.4.2/examples/test-c-server.c:83: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 msg[2048]; data/srt-1.4.2/examples/testcapi-connect.c:38:25: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). sa.sin_port = htons(atoi(argv[2])); data/srt-1.4.2/haicrypt/cryspr-gnutls.c:76:22: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 intxt[CRYSPR_AESBLKSZ]; data/srt-1.4.2/haicrypt/cryspr-gnutls.c:78: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(intxt, &indata[(nblk*CRYSPR_AESBLKSZ)], nmore); data/srt-1.4.2/haicrypt/cryspr-gnutls.c:142:37: [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(NULL == crysprGnuTLS_methods.open) { data/srt-1.4.2/haicrypt/cryspr-mbedtls.c:99:22: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 intxt[CRYSPR_AESBLKSZ]; data/srt-1.4.2/haicrypt/cryspr-mbedtls.c:101: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(intxt, &indata[(nblk*CRYSPR_AESBLKSZ)], nmore); data/srt-1.4.2/haicrypt/cryspr-mbedtls.c:132: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 ctr[CRYSPR_AESBLKSZ]; data/srt-1.4.2/haicrypt/cryspr-mbedtls.c:179:31: [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 (crysprMbedtls_methods.open) data/srt-1.4.2/haicrypt/cryspr-openssl.c:81:22: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 intxt[CRYSPR_AESBLKSZ]; data/srt-1.4.2/haicrypt/cryspr-openssl.c:83: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(intxt, &indata[(nblk*CRYSPR_AESBLKSZ)], nmore); data/srt-1.4.2/haicrypt/cryspr-openssl.c:112: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 ctr[CRYSPR_AESBLKSZ]; data/srt-1.4.2/haicrypt/cryspr-openssl.c:175:38: [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(NULL == crysprOpenSSL_methods.open) { data/srt-1.4.2/haicrypt/cryspr.c:147: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 *A, B[16], *R; data/srt-1.4.2/haicrypt/cryspr.c:154: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(out + 8, in, inlen); data/srt-1.4.2/haicrypt/cryspr.c:156: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(A, iv, 8); data/srt-1.4.2/haicrypt/cryspr.c:163: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(B + 8, R, 8); data/srt-1.4.2/haicrypt/cryspr.c:175: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(R, B + 8, 8); data/srt-1.4.2/haicrypt/cryspr.c:178:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, A, 8); data/srt-1.4.2/haicrypt/cryspr.c:187: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 *A, B[16], *R; data/srt-1.4.2/haicrypt/cryspr.c:197: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(A, in, 8); data/srt-1.4.2/haicrypt/cryspr.c:198: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(out, in + 8, inlen); data/srt-1.4.2/haicrypt/cryspr.c:211: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(B + 8, R, 8); data/srt-1.4.2/haicrypt/cryspr.c:216: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(R, B + 8, 8); data/srt-1.4.2/haicrypt/cryspr.c:327: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 ctr[HCRYPT_CTR_BLK_SZ]; data/srt-1.4.2/haicrypt/cryspr.c:333: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(ctr, iv, HCRYPT_CTR_BLK_SZ); data/srt-1.4.2/haicrypt/cryspr.c:341: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(csp, ctr, HCRYPT_CTR_BLK_SZ); data/srt-1.4.2/haicrypt/cryspr.c:384: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 iv[CRYSPR_AESBLKSZ]; data/srt-1.4.2/haicrypt/cryspr.c:412: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 iv[CRYSPR_AESBLKSZ]; data/srt-1.4.2/haicrypt/cryspr.c:454: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(out_msg, in_data[0].pfx, pfx_len); data/srt-1.4.2/haicrypt/cryspr.c:460: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(&out_msg[pfx_len], in_data[0].payload, in_data[0].len); data/srt-1.4.2/haicrypt/cryspr.c:461: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(out_msg, in_data[0].pfx, pfx_len); data/srt-1.4.2/haicrypt/cryspr.c:480: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(in_data[0].pfx, out_msg, pfx_len); data/srt-1.4.2/haicrypt/cryspr.c:487: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(in_data[0].payload, &out_msg[pfx_len], out_len); data/srt-1.4.2/haicrypt/cryspr.c:491: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(in_data[0].payload, &out_msg[pfx_len], out_len); data/srt-1.4.2/haicrypt/cryspr.c:495:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (pfx_len > 0) memcpy(out_msg, in_data[0].pfx, pfx_len); data/srt-1.4.2/haicrypt/cryspr.c:539: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 iv[CRYSPR_AESBLKSZ]; data/srt-1.4.2/haicrypt/cryspr.c:568: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 iv[CRYSPR_AESBLKSZ]; data/srt-1.4.2/haicrypt/cryspr.c:613: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(out_txt, in_data[0].payload, in_data[0].len); data/srt-1.4.2/haicrypt/cryspr.c:635: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(in_data[0].payload, out_txt, out_len); data/srt-1.4.2/haicrypt/cryspr.c:639: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(in_data[0].payload, out_txt, out_len); data/srt-1.4.2/haicrypt/cryspr.h:103:22: [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). CRYSPR_cb *(*open)( data/srt-1.4.2/haicrypt/haicrypt.h:56:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 str[HAICRYPT_SECRET_MAX_SZ]; data/srt-1.4.2/haicrypt/hcrypt.c:101:41: [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). crypto->cryspr_cb = crypto->cryspr->open(crypto->cryspr, cfg->data_max_len); data/srt-1.4.2/haicrypt/hcrypt.c:220: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(pcfg->secret.str, ctx->cfg.pwd, pcfg->secret.len); data/srt-1.4.2/haicrypt/hcrypt.c:285: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(cryptoClone, cryptoSrc, sizeof(*cryptoClone)); data/srt-1.4.2/haicrypt/hcrypt.c:299:55: [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). cryptoClone->cryspr_cb = cryptoClone->cryspr->open(cryptoClone->cryspr, cryptoClone->cfg.data_max_len); data/srt-1.4.2/haicrypt/hcrypt.h:138: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(&(iv)[10], (pki), HCRYPT_PKI_SZ); \ data/srt-1.4.2/haicrypt/hcrypt_ctx.h:76: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 pwd[HAICRYPT_PWD_MAX_SZ]; data/srt-1.4.2/haicrypt/hcrypt_ctx.h:80:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 salt[HAICRYPT_SALT_SZ]; data/srt-1.4.2/haicrypt/hcrypt_ctx.h:83:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 sek[HAICRYPT_KEY_MAX_SZ]; data/srt-1.4.2/haicrypt/hcrypt_ctx.h:90:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 KMmsg_cache[HCRYPT_CTX_MAX_KM_PFX_SZ + HCRYPT_MSG_KM_MAX_SZ]; data/srt-1.4.2/haicrypt/hcrypt_ctx.h:93:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 MSpfx_cache[HCRYPT_CTX_MAX_MS_PFX_SZ]; data/srt-1.4.2/haicrypt/hcrypt_ctx_rx.c:45: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->sek, sek, sek_len); data/srt-1.4.2/haicrypt/hcrypt_ctx_rx.c:58: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 seks[HAICRYPT_KEY_MAX_SZ * 2]; data/srt-1.4.2/haicrypt/hcrypt_ctx_rx.c:135: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->salt, &km_msg[HCRYPT_MSG_KM_OFS_SALT], salt_len); data/srt-1.4.2/haicrypt/hcrypt_ctx_rx.c:177: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->KMmsg_cache, km_msg, msg_len); data/srt-1.4.2/haicrypt/hcrypt_ctx_rx.c:183: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(alt->salt, &km_msg[HCRYPT_MSG_KM_OFS_SALT], salt_len); data/srt-1.4.2/haicrypt/hcrypt_ctx_rx.c:196:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(alt->KMmsg_cache, km_msg, msg_len); data/srt-1.4.2/haicrypt/hcrypt_ctx_tx.c:121: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->salt, ctxSrc->salt, ctx->salt_len); data/srt-1.4.2/haicrypt/hcrypt_ctx_tx.c:125: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->sek, ctxSrc->sek, ctx->sek_len); data/srt-1.4.2/haicrypt/hcrypt_ctx_tx.c:191:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(new_ctx->salt, ctx->salt, HAICRYPT_SALT_SZ); data/srt-1.4.2/haicrypt/hcrypt_ctx_tx.c:281: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 sek_buf[HAICRYPT_KEY_MAX_SZ * 2]; data/srt-1.4.2/haicrypt/hcrypt_ctx_tx.c:308: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(&km_msg[HCRYPT_MSG_KM_OFS_SALT], ctx->salt, ctx->salt_len); data/srt-1.4.2/haicrypt/hcrypt_ctx_tx.c:313: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(&sek_buf[0], ctx->sek, ctx->sek_len); data/srt-1.4.2/haicrypt/hcrypt_ctx_tx.c:314: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(&sek_buf[ctx->sek_len], alt_sek, ctx->sek_len); data/srt-1.4.2/haicrypt/hcrypt_ctx_tx.c:316: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(&sek_buf[0], alt_sek, ctx->sek_len); data/srt-1.4.2/haicrypt/hcrypt_ctx_tx.c:317: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(&sek_buf[ctx->sek_len], ctx->sek, ctx->sek_len); data/srt-1.4.2/haicrypt/hcrypt_sa.c:50: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->cfg.pwd, secret->str, secret->len); data/srt-1.4.2/haicrypt/hcrypt_sa.c:70: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 kek[HAICRYPT_KEY_MAX_SZ]; data/srt-1.4.2/haicrypt/hcrypt_ut.c:36: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 dk[32]; data/srt-1.4.2/haicrypt/hcrypt_ut.c:113: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 dk[32]; data/srt-1.4.2/haicrypt/hcrypt_ut.c:156: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 pkt[1500]; data/srt-1.4.2/haicrypt/hcrypt_xpt_srt.c:86:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&msg[HCRYPT_MSG_SRT_OFS_PKI], &pki, sizeof(pki)); //header is in host order data/srt-1.4.2/srtcore/api.cpp:619: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). ns->m_pUDT->open(); data/srt-1.4.2/srtcore/api.cpp:902:15: [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). s->m_pUDT->open(); data/srt-1.4.2/srtcore/api.cpp:931:15: [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). s->m_pUDT->open(); data/srt-1.4.2/srtcore/api.cpp:1162: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((pw_addr), &s->m_PeerAddr, len); data/srt-1.4.2/srtcore/api.cpp:1739:19: [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). s->m_pUDT->open(); data/srt-1.4.2/srtcore/api.cpp:1994: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((pw_name), &s->m_PeerAddr.sa, len); data/srt-1.4.2/srtcore/api.cpp:2018: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((pw_name), &s->m_SelfAddr.sa, len); data/srt-1.4.2/srtcore/api.cpp:2686:26: [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). m.m_pChannel->open(addr.family()); data/srt-1.4.2/srtcore/api.cpp:2693:26: [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). m.m_pChannel->open(addr); data/srt-1.4.2/srtcore/buffer.cpp:236: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((s->m_pcData), data + i * m_iMSS, pktlen); data/srt-1.4.2/srtcore/buffer.cpp:946: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((data), pkt.m_pcData + m_iNotch, unitsize); data/srt-1.4.2/srtcore/buffer.cpp:2142: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((data), m_pUnit[p]->m_Packet.m_pcData, unitsize); data/srt-1.4.2/srtcore/cache.cpp:116: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((aw_ip), addr.sin6.sin6_addr.s6_addr, sizeof addr.sin6.sin6_addr.s6_addr); data/srt-1.4.2/srtcore/channel.cpp:195: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 msg[160]; data/srt-1.4.2/srtcore/channel.cpp:203:16: [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). void CChannel::open(const sockaddr_any& addr) data/srt-1.4.2/srtcore/channel.cpp:217:16: [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). void CChannel::open(int family) data/srt-1.4.2/srtcore/channel.cpp:358:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[255]; data/srt-1.4.2/srtcore/channel.cpp:581:28: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). config.first = atoi(out[0].c_str()); data/srt-1.4.2/srtcore/channel.cpp:582:46: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). config.second = out.size() > 1 ? atoi(out[1].c_str()) : 8; data/srt-1.4.2/srtcore/channel.h:78:9: [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). void open(const sockaddr_any& addr); data/srt-1.4.2/srtcore/channel.h:80:9: [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). void open(int family); data/srt-1.4.2/srtcore/common.cpp:471:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 ip[4]; data/srt-1.4.2/srtcore/common.cpp:518:48: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 CMD5::compute(const char* input, unsigned char result[16]) data/srt-1.4.2/srtcore/common.cpp:746: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 tmp_buf[512]; data/srt-1.4.2/srtcore/common.h:842:52: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 void compute(const char* input, unsigned char result[16]); data/srt-1.4.2/srtcore/common.h:1395: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[20]; data/srt-1.4.2/srtcore/common.h:1396: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(buf, "%d.%d.%d", major, minor, patch); data/srt-1.4.2/srtcore/core.cpp:610: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((m_CryptoSecret.str), optval, m_CryptoSecret.len); data/srt-1.4.2/srtcore/core.cpp:1372: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(option->storage, optval, optlen); data/srt-1.4.2/srtcore/core.cpp:1509:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). void CUDT::open() data/srt-1.4.2/srtcore/core.cpp:1861: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((space), str.data(), str.size()); data/srt-1.4.2/srtcore/core.cpp:1903: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((space), storedata, sizeof storedata); data/srt-1.4.2/srtcore/core.cpp:3174:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char target[MAX_SID_LENGTH + 1]; data/srt-1.4.2/srtcore/core.cpp:3176:17: [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((target), begin + 1, bytelen); data/srt-1.4.2/srtcore/core.cpp:3205:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char target[MAX_SID_LENGTH + 1]; data/srt-1.4.2/srtcore/core.cpp:3207:17: [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((target), begin + 1, bytelen); data/srt-1.4.2/srtcore/core.cpp:3242:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char target[MAX_SID_LENGTH + 1]; data/srt-1.4.2/srtcore/core.cpp:3244:17: [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((target), begin + 1, bytelen); data/srt-1.4.2/srtcore/core.cpp:3275:17: [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(groupdata, begin+1, bytelen); data/srt-1.4.2/srtcore/core.cpp:4419:25: [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((kmdata), &m_pCryptoControl->m_RcvKmState, sizeof(int32_t)); data/srt-1.4.2/srtcore/core.cpp:4456:21: [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((kmdata), m_pCryptoControl->getKmMsg_data(0), msgsize); data/srt-1.4.2/srtcore/core.cpp:4873: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((m_piSelfIP), m_ConnRes.m_piPeerIP, sizeof m_piSelfIP); data/srt-1.4.2/srtcore/core.cpp:5748: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((m_piSelfIP), w_hs.m_piPeerIP, sizeof m_piSelfIP); data/srt-1.4.2/srtcore/core.cpp:10254: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 clienthost[NI_MAXHOST]; data/srt-1.4.2/srtcore/core.cpp:10255: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 clientport[NI_MAXSERV]; data/srt-1.4.2/srtcore/core.cpp:10268:22: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 cookie[16]; data/srt-1.4.2/srtcore/core.cpp:11019: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 target[MAX_SID_LENGTH + 1]; data/srt-1.4.2/srtcore/core.cpp:11059:17: [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((target), begin + 1, bytelen); data/srt-1.4.2/srtcore/core.h:149:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 storage[1]; // NOTE: Variable length object! data/srt-1.4.2/srtcore/core.h:484:10: [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). void open(); data/srt-1.4.2/srtcore/crypto.cpp:61: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 buf[256]; data/srt-1.4.2/srtcore/crypto.cpp:62:13: [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(buf, "??? (%d)", state); data/srt-1.4.2/srtcore/crypto.cpp:271:17: [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_SndKmMsg[0].Msg), kmdata, bytelen); data/srt-1.4.2/srtcore/crypto.cpp:486:54: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. int kix = hcryptMsg_KM_GetKeyIndex((unsigned char *)(out_p[i])); data/srt-1.4.2/srtcore/crypto.cpp:500: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((m_SndKmMsg[ki].Msg), out_p[i], out_len_p[i]); data/srt-1.4.2/srtcore/crypto.h:74:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 Msg[HCRYPT_MSG_KM_MAX_SZ]; data/srt-1.4.2/srtcore/fec.cpp:59:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int out_cols = atoi(colspec.c_str()); data/srt-1.4.2/srtcore/fec.cpp:71:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). out_rows = atoi(rowspec.c_str()); data/srt-1.4.2/srtcore/fec.cpp:657: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((out + off), &g.length_clip, sizeof g.length_clip); data/srt-1.4.2/srtcore/fec.cpp:661: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((out + off), &g.payload_clip[0], g.payload_clip.size()); data/srt-1.4.2/srtcore/group.cpp:661: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(optval, value.c_str(), value.size()); data/srt-1.4.2/srtcore/group.cpp:1638: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((&w_target.peeraddr), &source.peer, source.peer.size()); data/srt-1.4.2/srtcore/group.cpp:1850:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, &pos->packet[0], pos->packet.size()); data/srt-1.4.2/srtcore/group.cpp:2162:21: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char lostbuf[SRT_LIVE_MAX_PLSIZE]; data/srt-1.4.2/srtcore/group.cpp:2431:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, &pkt[0], pkt.size()); data/srt-1.4.2/srtcore/group.h:455: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(data, buf, s); data/srt-1.4.2/srtcore/handshake.h:205: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 m_aKey[1]; // dynamic size data/srt-1.4.2/srtcore/logging.h:143: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 prefix[MAX_PREFIX_SIZE+1]; data/srt-1.4.2/srtcore/logging.h:346: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 buf[512]; data/srt-1.4.2/srtcore/md5.cpp:169: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((xbuf), data, 64); data/srt-1.4.2/srtcore/md5.cpp:343:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((pms->buf + offset), p, copy); data/srt-1.4.2/srtcore/md5.cpp:357: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((pms->buf), p, left); data/srt-1.4.2/srtcore/netinet_any.h:152: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((&sin), source, sizeof sin); data/srt-1.4.2/srtcore/netinet_any.h:157: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((&sin6), source, sizeof sin6); data/srt-1.4.2/srtcore/netinet_any.h:175: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((&sin), source, sizeof sin); data/srt-1.4.2/srtcore/netinet_any.h:183: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((&sin6), source, sizeof sin6); data/srt-1.4.2/srtcore/netinet_any.h:194: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((&sin), &in4, sizeof in4); data/srt-1.4.2/srtcore/netinet_any.h:200: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((&sin6), &in6, sizeof in6); data/srt-1.4.2/srtcore/netinet_any.h:387: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 hostbuf[1024]; data/srt-1.4.2/srtcore/packet.cpp:488: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((pkt->m_nHeader), m_nHeader, HDR_SIZE); data/srt-1.4.2/srtcore/packet.cpp:490: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((pkt->m_pcData), m_pcData, m_PacketVector[PV_DATA].size()); data/srt-1.4.2/srtcore/packetfilter.cpp:149: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((hdr), m_sndctlpkt.hdr, SRT_PH_E_SIZE * sizeof(*hdr)); data/srt-1.4.2/srtcore/packetfilter.cpp:195: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((packet.getHeader()), i->hdr, CPacket::HDR_SIZE); data/srt-1.4.2/srtcore/packetfilter.cpp:196: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((packet.m_pcData), i->buffer, i->length); data/srt-1.4.2/srtcore/packetfilter_api.h:66: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 buffer[SRT_LIVE_MAX_PLSIZE]; data/srt-1.4.2/srtcore/queue.cpp:370: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((temp), m_pHeap, sizeof(CSNode *) * m_iArrayLength); data/srt-1.4.2/srtcore/queue.cpp:1612: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((w_packet.m_nHeader), newpkt->m_nHeader, CPacket::HDR_SIZE); data/srt-1.4.2/srtcore/queue.cpp:1613: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((w_packet.m_pcData), newpkt->m_pcData, newpkt->getLength()); data/srt-1.4.2/srtcore/srt_c_api.cpp:102: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(&data.srcaddr, src, namelen); data/srt-1.4.2/srtcore/srt_c_api.cpp:109: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(&data.peeraddr, adr, namelen); data/srt-1.4.2/srtcore/srt_compat.h:84: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/srt-1.4.2/srtcore/sync.cpp:68: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 tmp_buf[512]; data/srt-1.4.2/srtcore/threadname.h:26: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 old_name[128]; data/srt-1.4.2/srtcore/threadname.h:27: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 new_name[128]; data/srt-1.4.2/srtcore/utilities.h:905: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 spread[16]; data/srt-1.4.2/srtcore/utilities.h:910: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((spread), mem, min(size_t(16), size)); data/srt-1.4.2/srtcore/utilities.h:916: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 cells[4]; data/srt-1.4.2/test/test_cryspr.cpp:72:25: [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). EXPECT_NE(cryspr_m->open, nullPtr); data/srt-1.4.2/test/test_cryspr.cpp:94: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). TEST_F(TestCRYSPRmethods, open) data/srt-1.4.2/test/test_cryspr.cpp:96:25: [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). EXPECT_NE(cryspr_m->open, nullPtr); data/srt-1.4.2/test/test_cryspr.cpp:172:31: [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). cryspr_cb = cryspr_m->open(cryspr_m, UT_PKT_MAXLEN); data/srt-1.4.2/test/test_cryspr.cpp:213: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 kek[256/8]; data/srt-1.4.2/test/test_cryspr.cpp:287: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 kek[256/8]; data/srt-1.4.2/test/test_cryspr.cpp:348: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 sek[256/8]; /* key to wrap (unwrap result)*/ data/srt-1.4.2/test/test_cryspr.cpp:350: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 kek[256/8]; data/srt-1.4.2/test/test_cryspr.cpp:351: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 wrap[8+256/8]; /* wrapped sek (wrap result) */ data/srt-1.4.2/test/test_cryspr.cpp:392: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 wrap[HAICRYPT_WRAPKEY_SIGN_SZ+256/8]; data/srt-1.4.2/test/test_cryspr.cpp:428: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 sek[256/8]; data/srt-1.4.2/test/test_cryspr.cpp:491: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 sek[256/8]; /* Stream Encrypting Key*/ data/srt-1.4.2/test/test_cryspr.cpp:494: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 ciphertxt[32]; /* cipher text (encrypt result) */ data/srt-1.4.2/test/test_cryspr.cpp:562: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 result[128]; data/srt-1.4.2/test/test_cryspr.cpp:671: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 sek[256/8]; /* Stream Encrypting Key*/ data/srt-1.4.2/test/test_cryspr.cpp:673: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 iv[CRYSPR_AESBLKSZ];/* initial vector */ data/srt-1.4.2/test/test_cryspr.cpp:675: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 ciphertxt[24]; /* cipher text (encrypt result) */ data/srt-1.4.2/test/test_cryspr.cpp:717: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 result[100]; data/srt-1.4.2/test/test_cryspr.cpp:718: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 ivec[CRYSPR_AESBLKSZ]; data/srt-1.4.2/test/test_epoll.cpp:619: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 buffer[1316] = {1, 2, 3, 4}; data/srt-1.4.2/test/test_epoll.cpp:724: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 buffer[1316]; data/srt-1.4.2/test/test_epoll.cpp:727: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 pattern[4] = {1, 2, 3, 4}; data/srt-1.4.2/test/test_fec_rebuilding.cpp:152: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(chdr, fec_ctl.hdr, SRT_PH_E_SIZE * sizeof(*chdr)); data/srt-1.4.2/test/test_fec_rebuilding.cpp:229: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(chdr, fec_ctl.hdr, SRT_PH_E_SIZE * sizeof(*chdr)); data/srt-1.4.2/test/test_many_connections.cpp:129: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[SRT_LIVE_DEF_PLSIZE]; data/srt-1.4.2/test/test_muxer.cpp:84: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 buffer[1316] = {1, 2, 3, 4}; data/srt-1.4.2/test/test_muxer.cpp:168: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 buffer[1316]; data/srt-1.4.2/test/test_muxer.cpp:189: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 pattern[4] = {1, 2, 3, 4}; data/srt-1.4.2/testing/srt-test-file.cpp:206: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 tmppath[s_max_path]; data/srt-1.4.2/testing/srt-test-live.cpp:157:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char bufbw[64]; data/srt-1.4.2/testing/srt-test-live.cpp:158:17: [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(bufbw, "%d.%03d", abw_trunc, abw_frac); data/srt-1.4.2/testing/srt-test-live.cpp:753:24: [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). logfile_stream.open(logfile.c_str()); data/srt-1.4.2/testing/srt-test-live.cpp:1003: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 prefix[100] = ""; data/srt-1.4.2/testing/srt-test-live.cpp:1008: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/srt-1.4.2/testing/srt-test-multiplex.cpp:567: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). int iport = atoi(up.port().c_str()); data/srt-1.4.2/testing/srt-test-relay.cpp:484: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). int verboch = atoi(verbo.c_str()); data/srt-1.4.2/testing/testmedia.cpp:2730: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 buf[512]; data/srt-1.4.2/testing/testmedia.cpp:2892: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). iport = atoi(u.port().c_str()); data/srt-1.4.2/apps/apputil.cpp:50:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(srcCopy, src, INET6_ADDRSTRLEN + 1); data/srt-1.4.2/apps/srt-file-transmit.cpp:393:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t n = ifile.read(buf.data(), cfg.chunk_size).gcount(); data/srt-1.4.2/apps/srt-live-transmit.cpp:856:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(prefix, (char*)opaque, 99); data/srt-1.4.2/apps/transmitmedia.cpp:63:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ifile.read(pkt.payload.data(), chunk); data/srt-1.4.2/apps/transmitmedia.cpp:701:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool st = cin.read(pkt.payload.data(), chunk).good(); data/srt-1.4.2/examples/recvfile.cpp:60: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). int len = strlen(argv[3]); data/srt-1.4.2/examples/test-c-client-bonding.c:23:9: [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. #define usleep(x) Sleep(x / 1000) data/srt-1.4.2/examples/test-c-client-bonding.c:162:9: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(1000); // 1 ms data/srt-1.4.2/examples/test-c-client.c:23:9: [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. #define usleep(x) Sleep(x / 1000) data/srt-1.4.2/examples/test-c-client.c:86:9: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(1000); // 1 ms data/srt-1.4.2/srtcore/buffer.cpp:369:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ifs.read(s->m_pcData, pktlen); data/srt-1.4.2/srtcore/common.cpp:404:35: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. bool is_mapped_ipv4 = (std::mismatch(mbegin, mend, peeraddr16).first == mend); data/srt-1.4.2/srtcore/common.cpp:523:50: [1] (buffer) strlen: Does not handle 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_append(&state, (const md5_byte_t *)input, strlen(input)); data/srt-1.4.2/srtcore/core.cpp:1135: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). optlen = strlen((char*)optval); data/srt-1.4.2/srtcore/logging.h:166:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (logger_pfx && strlen(prefix) + strlen(logger_pfx) + 1 < MAX_PREFIX_SIZE) data/srt-1.4.2/srtcore/logging.h:166:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (logger_pfx && strlen(prefix) + strlen(logger_pfx) + 1 < MAX_PREFIX_SIZE) data/srt-1.4.2/srtcore/logging.h:168:13: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(prefix, ":"); data/srt-1.4.2/srtcore/logging.h:349: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). size_t len = strlen(buf); data/srt-1.4.2/srtcore/srt_compat.c:88:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, lpMsgBuf, buflen-1); data/srt-1.4.2/srtcore/srt_compat.c:134:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, gnu_buffer, buflen-1); data/srt-1.4.2/srtcore/sync.h:795:9: [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(count_microseconds(t)); // microseconds data/srt-1.4.2/test/test_connection_timeout.cpp:124:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SRTSOCKET read[2]; data/srt-1.4.2/test/test_connection_timeout.cpp:134:42: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). EXPECT_EQ(srt_epoll_wait(pollid, read, &rlen, data/srt-1.4.2/test/test_connection_timeout.cpp:151:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). EXPECT_EQ(read[0], client_sock); data/srt-1.4.2/test/test_epoll.cpp:39:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SRTSOCKET read[2]; data/srt-1.4.2/test/test_epoll.cpp:44:40: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_EQ(srt_epoll_wait(epoll_id, read, &rlen, write, &wlen, data/srt-1.4.2/test/test_epoll.cpp:138:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SRTSOCKET read[2]; data/srt-1.4.2/test/test_epoll.cpp:143:40: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_EQ(srt_epoll_wait(epoll_id, read, &rlen, write, &wlen, data/srt-1.4.2/test/test_epoll.cpp:322:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SRTSOCKET read[default_len]; data/srt-1.4.2/test/test_epoll.cpp:326:59: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). const int epoll_res = srt_epoll_wait(server_epoll_id, read, &rlen, data/srt-1.4.2/test/test_epoll.cpp:603:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SRTSOCKET read[2]; data/srt-1.4.2/test/test_epoll.cpp:608:55: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_NE(srt_epoll_wait(m_client_pollid, read, &rlen, data/srt-1.4.2/test/test_epoll.cpp:631:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SRTSOCKET read[2]; data/srt-1.4.2/test/test_epoll.cpp:636:66: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). EXPECT_EQ(SRT_ERROR, srt_epoll_wait(m_client_pollid, read, &rlen, data/srt-1.4.2/test/test_epoll.cpp:680:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SRTSOCKET read[2]; data/srt-1.4.2/test/test_epoll.cpp:686:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read, &rlen, data/srt-1.4.2/test/test_epoll.cpp:694:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_EQ(read[0], servsock); // read event is for bind socket data/srt-1.4.2/test/test_epoll.cpp:707:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SRTSOCKET read[2]; data/srt-1.4.2/test/test_epoll.cpp:713:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read, &rlen, data/srt-1.4.2/test/test_epoll.cpp:721:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_EQ(read[0], acpsock); // read event is for bind socket data/srt-1.4.2/test/test_epoll.cpp:728:26: [1] (buffer) mismatch: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. EXPECT_TRUE(std::mismatch(pattern, pattern+4, buffer).first == pattern+4); data/srt-1.4.2/test/test_epoll.cpp:733:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SRTSOCKET read[2]; data/srt-1.4.2/test/test_epoll.cpp:739:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read, &rlen, data/srt-1.4.2/test/test_file_transmission.cpp:125:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t n = ifile.read(buf.data(), 1456).gcount(); data/srt-1.4.2/test/test_listen_callback.cpp:150: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(streamid) > 4 && *(uint32_t*)streamid == *pattern) data/srt-1.4.2/test/test_muxer.cpp:68:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SRTSOCKET read[2]; data/srt-1.4.2/test/test_muxer.cpp:73:55: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_NE(srt_epoll_wait(m_client_pollid, read, &rlen, data/srt-1.4.2/test/test_muxer.cpp:144:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SRTSOCKET read[2]; data/srt-1.4.2/test/test_muxer.cpp:150:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read, &rlen, data/srt-1.4.2/test/test_muxer.cpp:157:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_EQ(read[0], m_listener_sock_ipv4) << "Read event on wrong socket"; data/srt-1.4.2/test/test_muxer.cpp:171:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). SRTSOCKET read[2]; data/srt-1.4.2/test/test_muxer.cpp:177:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read, &rlen, data/srt-1.4.2/test/test_muxer.cpp:186:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_EQ(read[0], accepted_sock); // read event is for bind socket data/srt-1.4.2/testing/srt-test-file.cpp:258:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t n = ifile.read(buf.data(), ::g_buffer_size).gcount(); data/srt-1.4.2/testing/srt-test-live.cpp:338: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(streamid) > 4 && *(uint32_t*)streamid == *pattern) data/srt-1.4.2/testing/srt-test-live.cpp:1005:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(prefix, (char*)opaque, 99); data/srt-1.4.2/testing/testmedia.cpp:98:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ifile.read(data.data(), chunk); data/srt-1.4.2/testing/testmedia.cpp:2502:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool st = cin.read(data.data(), chunk).good(); ANALYSIS SUMMARY: Hits = 331 Lines analyzed = 71957 in approximately 1.50 seconds (47941 lines/second) Physical Source Lines of Code (SLOC) = 46885 Hits@level = [0] 138 [1] 58 [2] 237 [3] 9 [4] 27 [5] 0 Hits@level+ = [0+] 469 [1+] 331 [2+] 273 [3+] 36 [4+] 27 [5+] 0 Hits/KSLOC@level+ = [0+] 10.0032 [1+] 7.05983 [2+] 5.82276 [3+] 0.767836 [4+] 0.575877 [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.