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/libssh-0.9.5/src/connector.c Examining data/libssh-0.9.5/src/session.c Examining data/libssh-0.9.5/src/kdf.c Examining data/libssh-0.9.5/src/dh_crypto.c Examining data/libssh-0.9.5/src/poll.c Examining data/libssh-0.9.5/src/auth.c Examining data/libssh-0.9.5/src/libgcrypt.c Examining data/libssh-0.9.5/src/bind.c Examining data/libssh-0.9.5/src/libmbedcrypto.c Examining data/libssh-0.9.5/src/socket.c Examining data/libssh-0.9.5/src/options.c Examining data/libssh-0.9.5/src/threads.c Examining data/libssh-0.9.5/src/external/bcrypt_pbkdf.c Examining data/libssh-0.9.5/src/external/curve25519_ref.c Examining data/libssh-0.9.5/src/external/blowfish.c Examining data/libssh-0.9.5/src/external/fe25519.c Examining data/libssh-0.9.5/src/external/sc25519.c Examining data/libssh-0.9.5/src/external/ed25519.c Examining data/libssh-0.9.5/src/external/ge25519.c Examining data/libssh-0.9.5/src/external/poly1305.c Examining data/libssh-0.9.5/src/external/chacha.c Examining data/libssh-0.9.5/src/bind_config.c Examining data/libssh-0.9.5/src/pki_gcrypt.c Examining data/libssh-0.9.5/src/wrapper.c Examining data/libssh-0.9.5/src/curve25519.c Examining data/libssh-0.9.5/src/callbacks.c Examining data/libssh-0.9.5/src/packet.c Examining data/libssh-0.9.5/src/libcrypto.c Examining data/libssh-0.9.5/src/pcap.c Examining data/libssh-0.9.5/src/dh-gex.c Examining data/libssh-0.9.5/src/ecdh_gcrypt.c Examining data/libssh-0.9.5/src/error.c Examining data/libssh-0.9.5/src/misc.c Examining data/libssh-0.9.5/src/gcrypt_missing.c Examining data/libssh-0.9.5/src/known_hosts.c Examining data/libssh-0.9.5/src/dh.c Examining data/libssh-0.9.5/src/base64.c Examining data/libssh-0.9.5/src/log.c Examining data/libssh-0.9.5/src/config.c Examining data/libssh-0.9.5/src/scp.c Examining data/libssh-0.9.5/src/pki_ed25519.c Examining data/libssh-0.9.5/src/client.c Examining data/libssh-0.9.5/src/packet_cb.c Examining data/libssh-0.9.5/src/pki.c Examining data/libssh-0.9.5/src/sftpserver.c Examining data/libssh-0.9.5/src/packet_crypt.c Examining data/libssh-0.9.5/src/legacy.c Examining data/libssh-0.9.5/src/init.c Examining data/libssh-0.9.5/src/dh_key.c Examining data/libssh-0.9.5/src/libcrypto-compat.c Examining data/libssh-0.9.5/src/ecdh.c Examining data/libssh-0.9.5/src/getpass.c Examining data/libssh-0.9.5/src/pki_mbedcrypto.c Examining data/libssh-0.9.5/src/sftp.c Examining data/libssh-0.9.5/src/messages.c Examining data/libssh-0.9.5/src/channels.c Examining data/libssh-0.9.5/src/threads/winlocks.c Examining data/libssh-0.9.5/src/threads/libgcrypt.c Examining data/libssh-0.9.5/src/threads/libcrypto.c Examining data/libssh-0.9.5/src/threads/mbedtls.c Examining data/libssh-0.9.5/src/threads/noop.c Examining data/libssh-0.9.5/src/threads/pthread.c Examining data/libssh-0.9.5/src/ecdh_mbedcrypto.c Examining data/libssh-0.9.5/src/token.c Examining data/libssh-0.9.5/src/server.c Examining data/libssh-0.9.5/src/agent.c Examining data/libssh-0.9.5/src/kex.c Examining data/libssh-0.9.5/src/pki_crypto.c Examining data/libssh-0.9.5/src/match.c Examining data/libssh-0.9.5/src/chachapoly.c Examining data/libssh-0.9.5/src/connect.c Examining data/libssh-0.9.5/src/bignum.c Examining data/libssh-0.9.5/src/knownhosts.c Examining data/libssh-0.9.5/src/gssapi.c Examining data/libssh-0.9.5/src/libcrypto-compat.h Examining data/libssh-0.9.5/src/buffer.c Examining data/libssh-0.9.5/src/mbedcrypto_missing.c Examining data/libssh-0.9.5/src/string.c Examining data/libssh-0.9.5/src/ecdh_crypto.c Examining data/libssh-0.9.5/src/pki_ed25519_common.c Examining data/libssh-0.9.5/src/pki_container_openssh.c Examining data/libssh-0.9.5/src/config_parser.c Examining data/libssh-0.9.5/src/gzip.c Examining data/libssh-0.9.5/tests/test_exec.c Examining data/libssh-0.9.5/tests/ssh_ping.c Examining data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c Examining data/libssh-0.9.5/tests/unittests/torture_rand.c Examining data/libssh-0.9.5/tests/unittests/torture_options.c Examining data/libssh-0.9.5/tests/unittests/torture_pki_ecdsa.c Examining data/libssh-0.9.5/tests/unittests/torture_server_x11.c Examining data/libssh-0.9.5/tests/unittests/torture_packet.c Examining data/libssh-0.9.5/tests/unittests/torture_config.c Examining data/libssh-0.9.5/tests/unittests/torture_threads_buffer.c Examining data/libssh-0.9.5/tests/unittests/torture_threads_pki_rsa.c Examining data/libssh-0.9.5/tests/unittests/torture_buffer.c Examining data/libssh-0.9.5/tests/unittests/torture_callbacks.c Examining data/libssh-0.9.5/tests/unittests/torture_list.c Examining data/libssh-0.9.5/tests/unittests/torture_temp_file.c Examining data/libssh-0.9.5/tests/unittests/torture_packet_filter.c Examining data/libssh-0.9.5/tests/unittests/torture_crypto.c Examining data/libssh-0.9.5/tests/unittests/torture_hashes.c Examining data/libssh-0.9.5/tests/unittests/torture_threads_init.c Examining data/libssh-0.9.5/tests/unittests/torture_temp_dir.c Examining data/libssh-0.9.5/tests/unittests/torture_moduli.c Examining data/libssh-0.9.5/tests/unittests/torture_channel.c Examining data/libssh-0.9.5/tests/unittests/torture_session_keys.c Examining data/libssh-0.9.5/tests/unittests/torture_keyfiles.c Examining data/libssh-0.9.5/tests/unittests/torture_init.c Examining data/libssh-0.9.5/tests/unittests/torture_bytearray.c Examining data/libssh-0.9.5/tests/unittests/torture_isipaddr.c Examining data/libssh-0.9.5/tests/unittests/torture_pki_ed25519.c Examining data/libssh-0.9.5/tests/unittests/torture_pki_dsa.c Examining data/libssh-0.9.5/tests/unittests/torture_pki.c Examining data/libssh-0.9.5/tests/unittests/torture_tokens.c Examining data/libssh-0.9.5/tests/unittests/torture_pki_rsa.c Examining data/libssh-0.9.5/tests/unittests/torture_threads_crypto.c Examining data/libssh-0.9.5/tests/unittests/torture_push_pop_dir.c Examining data/libssh-0.9.5/tests/unittests/torture_bind_config.c Examining data/libssh-0.9.5/tests/unittests/torture_misc.c Examining data/libssh-0.9.5/tests/tests.h Examining data/libssh-0.9.5/tests/client/torture_scp.c Examining data/libssh-0.9.5/tests/client/torture_knownhosts_verify.c Examining data/libssh-0.9.5/tests/client/torture_algorithms.c Examining data/libssh-0.9.5/tests/client/torture_hostkey.c Examining data/libssh-0.9.5/tests/client/torture_sftp_benchmark.c Examining data/libssh-0.9.5/tests/client/torture_session.c Examining data/libssh-0.9.5/tests/client/torture_sftp_ext.c Examining data/libssh-0.9.5/tests/client/torture_auth.c Examining data/libssh-0.9.5/tests/client/torture_client_config.c Examining data/libssh-0.9.5/tests/client/torture_sftp_canonicalize_path.c Examining data/libssh-0.9.5/tests/client/torture_sftp_read.c Examining data/libssh-0.9.5/tests/client/torture_knownhosts.c Examining data/libssh-0.9.5/tests/client/torture_proxycommand.c Examining data/libssh-0.9.5/tests/client/torture_connect.c Examining data/libssh-0.9.5/tests/client/torture_rekey.c Examining data/libssh-0.9.5/tests/client/torture_request_env.c Examining data/libssh-0.9.5/tests/client/torture_client_global_requests.c Examining data/libssh-0.9.5/tests/client/torture_sftp_fsync.c Examining data/libssh-0.9.5/tests/client/torture_sftp_dir.c Examining data/libssh-0.9.5/tests/client/torture_forward.c Examining data/libssh-0.9.5/tests/torture_pki.h Examining data/libssh-0.9.5/tests/torture_cmocka.c Examining data/libssh-0.9.5/tests/torture.c Examining data/libssh-0.9.5/tests/server/test_server/default_cb.c Examining data/libssh-0.9.5/tests/server/test_server/test_server.c Examining data/libssh-0.9.5/tests/server/test_server/test_server.h Examining data/libssh-0.9.5/tests/server/test_server/default_cb.h Examining data/libssh-0.9.5/tests/server/test_server/main.c Examining data/libssh-0.9.5/tests/server/torture_server.c Examining data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c Examining data/libssh-0.9.5/tests/server/torture_server_config.c Examining data/libssh-0.9.5/tests/test_ssh_bind_accept_fd.c Examining data/libssh-0.9.5/tests/cmdline.c Examining data/libssh-0.9.5/tests/torture_cmocka.h Examining data/libssh-0.9.5/tests/pkd/pkd_keyutil.h Examining data/libssh-0.9.5/tests/pkd/pkd_keyutil.c Examining data/libssh-0.9.5/tests/pkd/pkd_hello.c Examining data/libssh-0.9.5/tests/pkd/pkd_daemon.c Examining data/libssh-0.9.5/tests/pkd/pkd_util.c Examining data/libssh-0.9.5/tests/pkd/pkd_util.h Examining data/libssh-0.9.5/tests/pkd/pkd_daemon.h Examining data/libssh-0.9.5/tests/pkd/pkd_client.h Examining data/libssh-0.9.5/tests/fuzz/ssh_server_fuzzer.cpp Examining data/libssh-0.9.5/tests/test_tunnel.c Examining data/libssh-0.9.5/tests/test_pcap.c Examining data/libssh-0.9.5/tests/chmodtest.c Examining data/libssh-0.9.5/tests/torture.h Examining data/libssh-0.9.5/tests/benchmarks/benchmarks.h Examining data/libssh-0.9.5/tests/benchmarks/latency.c Examining data/libssh-0.9.5/tests/benchmarks/benchmarks.c Examining data/libssh-0.9.5/tests/benchmarks/bench_scp.c Examining data/libssh-0.9.5/tests/benchmarks/bench_raw.c Examining data/libssh-0.9.5/tests/benchmarks/bench_sftp.c Examining data/libssh-0.9.5/tests/torture_key.c Examining data/libssh-0.9.5/tests/authentication.c Examining data/libssh-0.9.5/tests/torture_pki.c Examining data/libssh-0.9.5/tests/torture_key.h Examining data/libssh-0.9.5/tests/test_socket.c Examining data/libssh-0.9.5/tests/connection.c Examining data/libssh-0.9.5/tests/sftp_stress/main.c Examining data/libssh-0.9.5/tests/chroot_wrapper.c Examining data/libssh-0.9.5/include/libssh/string.h Examining data/libssh-0.9.5/include/libssh/dh-gex.h Examining data/libssh-0.9.5/include/libssh/gssapi.h Examining data/libssh-0.9.5/include/libssh/agent.h Examining data/libssh-0.9.5/include/libssh/keys.h Examining data/libssh-0.9.5/include/libssh/buffer.h Examining data/libssh-0.9.5/include/libssh/scp.h Examining data/libssh-0.9.5/include/libssh/kex.h Examining data/libssh-0.9.5/include/libssh/libmbedcrypto.h Examining data/libssh-0.9.5/include/libssh/poll.h Examining data/libssh-0.9.5/include/libssh/ssh2.h Examining data/libssh-0.9.5/include/libssh/libssh.h Examining data/libssh-0.9.5/include/libssh/wrapper.h Examining data/libssh-0.9.5/include/libssh/callbacks.h Examining data/libssh-0.9.5/include/libssh/libcrypto.h Examining data/libssh-0.9.5/include/libssh/priv.h Examining data/libssh-0.9.5/include/libssh/threads.h Examining data/libssh-0.9.5/include/libssh/chacha.h Examining data/libssh-0.9.5/include/libssh/sftp.h Examining data/libssh-0.9.5/include/libssh/libsshpp.hpp Examining data/libssh-0.9.5/include/libssh/messages.h Examining data/libssh-0.9.5/include/libssh/bytearray.h Examining data/libssh-0.9.5/include/libssh/config.h Examining data/libssh-0.9.5/include/libssh/socket.h Examining data/libssh-0.9.5/include/libssh/server.h Examining data/libssh-0.9.5/include/libssh/bind_config.h Examining data/libssh-0.9.5/include/libssh/channels.h Examining data/libssh-0.9.5/include/libssh/pki_priv.h Examining data/libssh-0.9.5/include/libssh/fe25519.h Examining data/libssh-0.9.5/include/libssh/bignum.h Examining data/libssh-0.9.5/include/libssh/ecdh.h Examining data/libssh-0.9.5/include/libssh/pki.h Examining data/libssh-0.9.5/include/libssh/knownhosts.h Examining data/libssh-0.9.5/include/libssh/poly1305.h Examining data/libssh-0.9.5/include/libssh/crypto.h Examining data/libssh-0.9.5/include/libssh/blf.h Examining data/libssh-0.9.5/include/libssh/token.h Examining data/libssh-0.9.5/include/libssh/misc.h Examining data/libssh-0.9.5/include/libssh/auth.h Examining data/libssh-0.9.5/include/libssh/packet.h Examining data/libssh-0.9.5/include/libssh/ed25519.h Examining data/libssh-0.9.5/include/libssh/dh.h Examining data/libssh-0.9.5/include/libssh/ge25519.h Examining data/libssh-0.9.5/include/libssh/config_parser.h Examining data/libssh-0.9.5/include/libssh/session.h Examining data/libssh-0.9.5/include/libssh/libgcrypt.h Examining data/libssh-0.9.5/include/libssh/legacy.h Examining data/libssh-0.9.5/include/libssh/pcap.h Examining data/libssh-0.9.5/include/libssh/sftp_priv.h Examining data/libssh-0.9.5/include/libssh/options.h Examining data/libssh-0.9.5/include/libssh/curve25519.h Examining data/libssh-0.9.5/include/libssh/sc25519.h Examining data/libssh-0.9.5/include/libssh/bind.h Examining data/libssh-0.9.5/examples/samplesshd-kbdint.c Examining data/libssh-0.9.5/examples/examples_common.h Examining data/libssh-0.9.5/examples/sshnetcat.c Examining data/libssh-0.9.5/examples/libsshpp_noexcept.cpp Examining data/libssh-0.9.5/examples/keygen.c Examining data/libssh-0.9.5/examples/senddata.c Examining data/libssh-0.9.5/examples/libsshpp.cpp Examining data/libssh-0.9.5/examples/sshd_direct-tcpip.c Examining data/libssh-0.9.5/examples/exec.c Examining data/libssh-0.9.5/examples/ssh_server_fork.c Examining data/libssh-0.9.5/examples/scp_download.c Examining data/libssh-0.9.5/examples/samplesftp.c Examining data/libssh-0.9.5/examples/authentication.c Examining data/libssh-0.9.5/examples/samplesshd-cb.c Examining data/libssh-0.9.5/examples/libssh_scp.c Examining data/libssh-0.9.5/examples/proxy.c Examining data/libssh-0.9.5/examples/knownhosts.c Examining data/libssh-0.9.5/examples/connect_ssh.c Examining data/libssh-0.9.5/examples/ssh_client.c Examining data/libssh-0.9.5/debian/tests/mock-sshd.c FINAL RESULTS: data/libssh-0.9.5/tests/torture.c:455:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(template,0777); data/libssh-0.9.5/debian/tests/mock-sshd.c:313:7: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl ("/bin/bash", "/bin/bash", NULL); data/libssh-0.9.5/debian/tests/mock-sshd.c:364:7: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl ("/bin/sh", "/bin/sh", "-c", cmd, NULL); data/libssh-0.9.5/examples/ssh_server_fork.c:326:13: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl("/bin/sh", "sh", mode, command, NULL); data/libssh-0.9.5/examples/ssh_server_fork.c:365:13: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl("/bin/sh", "sh", "-c", command, NULL); data/libssh-0.9.5/include/libssh/libsshpp.hpp:376:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buffer, sizeof(buffer), format, va); data/libssh-0.9.5/include/libssh/priv.h:122:11: [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. # undef snprintf data/libssh-0.9.5/include/libssh/priv.h:123:12: [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(d, n, ...) _snprintf_s((d), (n), _TRUNCATE, __VA_ARGS__) data/libssh-0.9.5/include/libssh/priv.h:126:13: [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. # undef snprintf data/libssh-0.9.5/include/libssh/priv.h:127:14: [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/libssh-0.9.5/include/libssh/priv.h:127:23: [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/libssh-0.9.5/include/libssh/priv.h:136:11: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # undef vsnprintf data/libssh-0.9.5/include/libssh/priv.h:137:12: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # define vsnprintf(s, n, f, v) _vsnprintf_s((s), (n), _TRUNCATE, (f), (v)) data/libssh-0.9.5/include/libssh/priv.h:140:12: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # undef vsnprintf data/libssh-0.9.5/include/libssh/priv.h:141:13: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # define vsnprintf _vsnprintf data/libssh-0.9.5/src/error.c:62:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(err->error.error_buffer, ERROR_BUFFERLEN, descr, va); data/libssh-0.9.5/src/log.c:126:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buffer, sizeof(buffer), format, va); data/libssh-0.9.5/src/log.c:143:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buffer, sizeof(buffer), format, va); data/libssh-0.9.5/src/log.c:165:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buffer, sizeof(buffer), format, va); data/libssh-0.9.5/src/misc.c:117:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(szPath, tmp); data/libssh-0.9.5/src/misc.c:268: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. if (access(file, R_OK) < 0) { data/libssh-0.9.5/src/socket.c:887:5: [4] (shell) execv: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execv(args[0], (char * const *)args); data/libssh-0.9.5/src/token.c:400: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(concat, list); data/libssh-0.9.5/tests/authentication.c:40:21: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. ptr=getpass(prompt); data/libssh-0.9.5/tests/authentication.c:65:18: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. password=getpass("Password : "); data/libssh-0.9.5/tests/benchmarks/latency.c:57:6: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. fd=popen(cmd,"r"); data/libssh-0.9.5/tests/client/torture_auth.c:146:10: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. rc = system(ssh_agent_cmd); data/libssh-0.9.5/tests/client/torture_auth.c:157:10: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. rc = system(bob_ssh_key); data/libssh-0.9.5/tests/client/torture_auth.c:183:10: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. rc = system(bob_alt_ssh_key); data/libssh-0.9.5/tests/client/torture_proxycommand.c:80:10: [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. rc = snprintf(command, sizeof(command), NC_EXECUTABLE " %s %d", address, port); data/libssh-0.9.5/tests/client/torture_scp.c:605:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf, BUF_SIZE, ALICE_HOME "/hack"); data/libssh-0.9.5/tests/pkd/pkd_daemon.c:43:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stdout, fmt, vargs); data/libssh-0.9.5/tests/pkd/pkd_daemon.c:52:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, vargs); data/libssh-0.9.5/tests/pkd/pkd_daemon.c:312: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. snprintf(all_kex, kex_len, "%s," GEX_SHA1, default_kex); data/libssh-0.9.5/tests/pkd/pkd_hello.c:615: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. snprintf(&testcmd[0], sizeof(testcmd), sshcmd, tname, tname); \ data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:27: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. if (access(LIBSSH_RSA_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:36: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. if (access(LIBSSH_ED25519_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:46: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. if (access(LIBSSH_DSA_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:57: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. if (access(LIBSSH_ECDSA_256_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:62: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. if (access(LIBSSH_ECDSA_384_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:67: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. if (access(LIBSSH_ECDSA_521_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:97: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. if (access(OPENSSH_CA_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:103: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. if (access(OPENSSH_RSA_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:109: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. if (access(OPENSSH_RSA_TESTKEY "-cert.pub", F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:115: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. if (access(OPENSSH_RSA_TESTKEY "-sha256-cert.pub", F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:122: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. if (access(OPENSSH_ECDSA256_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:128: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. if (access(OPENSSH_ECDSA256_TESTKEY "-cert.pub", F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:134: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. if (access(OPENSSH_ECDSA384_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:140: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. if (access(OPENSSH_ECDSA384_TESTKEY "-cert.pub", F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:146: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. if (access(OPENSSH_ECDSA521_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:152: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. if (access(OPENSSH_ECDSA521_TESTKEY "-cert.pub", F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:160:13: [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(OPENSSH_DSA_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:166:13: [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(OPENSSH_DSA_TESTKEY "-cert.pub", F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:173:13: [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(OPENSSH_ED25519_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:179:13: [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(OPENSSH_ED25519_TESTKEY "-cert.pub", F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.c:204: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. if (access(DROPBEAR_RSA_TESTKEY, F_OK) != 0) { data/libssh-0.9.5/tests/pkd/pkd_keyutil.h:55: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. if (access((name), F_OK) != -1) {\ data/libssh-0.9.5/tests/pkd/pkd_util.c:23:14: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. int rc = system(cmd); data/libssh-0.9.5/tests/pkd/pkd_util.c:57:10: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. fp = popen("ssh -V 2>&1", "r"); data/libssh-0.9.5/tests/server/test_server/default_cb.c:422:9: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl("/bin/sh", "sh", mode, command, NULL); data/libssh-0.9.5/tests/server/test_server/default_cb.c:471:13: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl("/bin/sh", "sh", "-c", command, NULL); data/libssh-0.9.5/tests/torture.c:790: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. snprintf(sshd_config, sizeof(sshd_config), data/libssh-0.9.5/tests/torture.c:800: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. snprintf(sshd_config, sizeof(sshd_config), data/libssh-0.9.5/tests/torture.c:826:14: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. rc = system(SSH_PING_EXECUTABLE " " TORTURE_SSH_SERVER); data/libssh-0.9.5/tests/torture.c:851:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(sshd_start_cmd, sizeof(sshd_start_cmd), data/libssh-0.9.5/tests/torture.c:855:10: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. rc = system(sshd_start_cmd); data/libssh-0.9.5/tests/torture.c:1125:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(file_path, path); data/libssh-0.9.5/tests/torture.c:1156:13: [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(file_path, path); data/libssh-0.9.5/tests/torture.c:1158: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(file_path, file_data.cFileName); data/libssh-0.9.5/examples/libssh_scp.c:59:16: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((i = getopt(argc, argv, "v")) != -1) { data/libssh-0.9.5/examples/samplesftp.c:253:17: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((i = getopt(argc, argv, "v")) != -1) { data/libssh-0.9.5/examples/scp_download.c:44:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((i=getopt(argc,argv,"v"))!=-1){ data/libssh-0.9.5/examples/ssh_client.c:113:16: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((i = getopt(argc,argv,"T:P:")) != -1) { data/libssh-0.9.5/examples/sshnetcat.c:54:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((i=getopt(argc,argv,"P:"))!=-1){ data/libssh-0.9.5/src/agent.c:219:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. auth_sock = getenv("SSH_AUTH_SOCK"); data/libssh-0.9.5/src/misc.c:251:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. szPath = getenv("HOME"); data/libssh-0.9.5/src/options.c:1221:18: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((opt = getopt(argc, argv, "c:i:Cl:p:vb:rd12")) != -1) { data/libssh-0.9.5/src/threads/winlocks.c:38:5: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. InitializeCriticalSection(lock); data/libssh-0.9.5/src/threads/winlocks.c:55:5: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection((CRITICAL_SECTION *) *lock); data/libssh-0.9.5/src/threads/winlocks.c:95:9: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. InitializeCriticalSection(mutex_tmp); data/libssh-0.9.5/src/threads/winlocks.c:107:5: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(*mutex); data/libssh-0.9.5/tests/chroot_wrapper.c:2:5: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. int chroot(const char *); data/libssh-0.9.5/tests/chroot_wrapper.c:4:5: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. int chroot(const char *path) data/libssh-0.9.5/tests/client/torture_auth.c:199:25: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. ssh_agent_pidfile = getenv("TORTURE_SSH_AGENT_PIDFILE"); data/libssh-0.9.5/tests/connection.c:17:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((i=getopt(argc,argv,""))!=-1){ data/libssh-0.9.5/tests/server/torture_server.c:135:19: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. sftp_server = getenv("TORTURE_SFTP_SERVER"); data/libssh-0.9.5/tests/sftp_stress/main.c:58:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/libssh-0.9.5/tests/sftp_stress/main.c:65:5: [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(i); data/libssh-0.9.5/tests/torture.c:489:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *env = getenv("TORTURE_SERVER_PORT"); data/libssh-0.9.5/tests/torture.c:506:27: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char *ip4 = getenv("TORTURE_SERVER_ADDRESS_IPV4"); data/libssh-0.9.5/tests/torture.c:515:27: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char *ip6 = getenv("TORTURE_SERVER_ADDRESS_IPV6"); data/libssh-0.9.5/tests/torture.c:542:11: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env = getenv("TORTURE_PLAIN_PCAP_FILE"); data/libssh-0.9.5/tests/torture.c:583:11: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env = getenv("TORTURE_GENERATE_PCAP"); data/libssh-0.9.5/tests/torture.c:774:19: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. sftp_server = getenv("TORTURE_SFTP_SERVER"); data/libssh-0.9.5/tests/torture.c:869:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *env = getenv("TORTURE_SKIP_CLEANUP"); data/libssh-0.9.5/tests/torture.c:1348:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *env = getenv("LIBSSH_VERBOSITY"); data/libssh-0.9.5/tests/unittests/torture_misc.c:132:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. user = getenv("USER"); data/libssh-0.9.5/tests/unittests/torture_misc.c:134:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. user = getenv("LOGNAME"); data/libssh-0.9.5/tests/unittests/torture_misc.c:144:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. home = getenv("HOME"); data/libssh-0.9.5/debian/tests/mock-sshd.c:67:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char *prompts[2] = { "Password", "Token" }; data/libssh-0.9.5/debian/tests/mock-sshd.c:69:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char *again[1] = { "So Close" }; data/libssh-0.9.5/debian/tests/mock-sshd.c:561:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char portname[16]; data/libssh-0.9.5/debian/tests/mock-sshd.c:562:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char addrname[16]; data/libssh-0.9.5/examples/authentication.c:35: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[128]; data/libssh-0.9.5/examples/authentication.c:106: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 pubkey[132] = {0}; // +".pub" data/libssh-0.9.5/examples/authentication.c:145: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 password[128] = {0}; data/libssh-0.9.5/examples/authentication.c:177: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 buffer[128] = {0}; data/libssh-0.9.5/examples/exec.c:10: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[256]; data/libssh-0.9.5/examples/knownhosts.c:38: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[10]; data/libssh-0.9.5/examples/libssh_scp.c:233:21: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). loc->file = fopen(loc->path, flag == READ ? "r":"w"); data/libssh-0.9.5/examples/libssh_scp.c:264: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[16384]; data/libssh-0.9.5/examples/libssh_scp.c:326:26: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dest->file = fopen(filename, "w"); data/libssh-0.9.5/examples/proxy.c:228: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[2048]; data/libssh-0.9.5/examples/proxy.c:229: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 host[128]=""; data/libssh-0.9.5/examples/samplesftp.c:47: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 data[DATALEN] = {0}; data/libssh-0.9.5/examples/samplesshd-cb.c:229: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[2048]; data/libssh-0.9.5/examples/samplesshd-kbdint.c:148:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). port = atoi(arg); data/libssh-0.9.5/examples/samplesshd-kbdint.c:188:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char *prompts[2]; data/libssh-0.9.5/examples/samplesshd-kbdint.c:296: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[2048]; data/libssh-0.9.5/examples/scp_download.c:63:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1]; data/libssh-0.9.5/examples/scp_download.c:105:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[16384]; data/libssh-0.9.5/examples/senddata.c:11:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1024*1024]; data/libssh-0.9.5/examples/ssh_client.c:49:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char *cmds[MAXCMD]; data/libssh-0.9.5/examples/ssh_client.c:257: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(&terminal, &terminal_local, sizeof(struct termios)); data/libssh-0.9.5/examples/ssh_client.c:293: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[1024]; data/libssh-0.9.5/examples/ssh_server_fork.c:77:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char authorizedkeys[DEF_STR_SIZE] = {0}; data/libssh-0.9.5/examples/ssh_server_fork.c:507: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[BUF_SIZE]; data/libssh-0.9.5/examples/ssh_server_fork.c:522: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[BUF_SIZE]; data/libssh-0.9.5/examples/sshd_direct-tcpip.c:352:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[16384]; data/libssh-0.9.5/examples/sshd_direct-tcpip.c:468: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((char *)&sin.sin_addr.s_addr, (char *)host->h_addr, host->h_length); data/libssh-0.9.5/examples/sshnetcat.c:80:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[4096]; data/libssh-0.9.5/examples/sshnetcat.c:181:53: [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). r = ssh_channel_open_forward(channel, desthost, atoi(port), "localhost", 22); data/libssh-0.9.5/include/libssh/bind.h:35:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *wanted_methods[SSH_KEX_METHODS]; data/libssh-0.9.5/include/libssh/crypto.h:138: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 hmacbuf[DIGEST_MAX_LEN]; data/libssh-0.9.5/include/libssh/crypto.h:153: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 *kex_methods[SSH_KEX_METHODS]; data/libssh-0.9.5/include/libssh/crypto.h:167: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 last_iv[AES_GCM_IVLEN]; data/libssh-0.9.5/include/libssh/crypto.h:179: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 last_iv[AES_GCM_IVLEN]; data/libssh-0.9.5/include/libssh/curve25519.h:46: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. typedef unsigned char ssh_curve25519_pubkey[CURVE25519_PUBKEY_SIZE]; data/libssh-0.9.5/include/libssh/curve25519.h:47: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. typedef unsigned char ssh_curve25519_privkey[CURVE25519_PRIVKEY_SIZE]; data/libssh-0.9.5/include/libssh/fe25519.h:38: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 fe25519_unpack(fe25519 *r, const unsigned char x[32]); data/libssh-0.9.5/include/libssh/fe25519.h:40:28: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 fe25519_pack(unsigned char r[32], const fe25519 *x); data/libssh-0.9.5/include/libssh/ge25519.h:33:58: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 ge25519_unpackneg_vartime(ge25519 *r, const unsigned char p[32]); data/libssh-0.9.5/include/libssh/ge25519.h:35:28: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 ge25519_pack(unsigned char r[32], const ge25519 *p); data/libssh-0.9.5/include/libssh/kex.h:30: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 cookie[16]; data/libssh-0.9.5/include/libssh/kex.h:31: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 *methods[SSH_KEX_METHODS]; data/libssh-0.9.5/include/libssh/libsshpp.hpp:372: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[1024]; data/libssh-0.9.5/include/libssh/priv.h:256: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 error_buffer[ERROR_BUFFERLEN]; data/libssh-0.9.5/include/libssh/sc25519.h:38:53: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 sc25519_from32bytes(sc25519 *r, const unsigned char x[32]); data/libssh-0.9.5/include/libssh/sc25519.h:40:63: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 shortsc25519_from16bytes(shortsc25519 *r, const unsigned char x[16]); data/libssh-0.9.5/include/libssh/sc25519.h:42:53: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 sc25519_from64bytes(sc25519 *r, const unsigned char x[64]); data/libssh-0.9.5/include/libssh/sc25519.h:46:33: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void sc25519_to32bytes(unsigned char r[32], const sc25519 *x); data/libssh-0.9.5/include/libssh/sc25519.h:65:29: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 sc25519_window3(signed char r[85], const sc25519 *s); data/libssh-0.9.5/include/libssh/sc25519.h:70:29: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 sc25519_window5(signed char r[51], const sc25519 *s); data/libssh-0.9.5/include/libssh/sc25519.h:72:36: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 sc25519_2interleave2(unsigned char r[127], const sc25519 *s1, const sc25519 *s2); data/libssh-0.9.5/include/libssh/session.h:216: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 *wanted_methods[SSH_KEX_METHODS]; data/libssh-0.9.5/include/libssh/string.h:31: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 data[1]; data/libssh-0.9.5/src/auth.c:1057: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 pubkey_file[1024] = {0}; data/libssh-0.9.5/src/base64.c:47:36: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 int _base64_to_bin(unsigned char dest[3], const char *source, int num); data/libssh-0.9.5/src/base64.c:62: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 block[3]; data/libssh-0.9.5/src/base64.c:175:50: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. #define BLOCK(letter, n) do {ptr = strchr((const char *)alphabet, source[n]); \ data/libssh-0.9.5/src/base64.c:210:36: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 int _base64_to_bin(unsigned char dest[3], const char *source, int num) { data/libssh-0.9.5/src/bind.c:76: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 port_c[6]; data/libssh-0.9.5/src/bind_config.c:198: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 line[MAX_LINE_SIZE] = {0}; data/libssh-0.9.5/src/bind_config.c:202:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(filename, "r"); data/libssh-0.9.5/src/bind_config.c:607: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 line[MAX_LINE_SIZE] = {0}; data/libssh-0.9.5/src/bind_config.c:619:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(filename, "r"); data/libssh-0.9.5/src/buffer.c:206: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(new, buffer->data, buffer->used); data/libssh-0.9.5/src/buffer.c:325: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(buffer->data + buffer->used, data, len); data/libssh-0.9.5/src/buffer.c:535: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(buffer->data + (buffer->pos - len), data, len); data/libssh-0.9.5/src/buffer.c:551: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(buffer->data, data, len); data/libssh-0.9.5/src/buffer.c:688: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,buffer->data+buffer->pos,len); data/libssh-0.9.5/src/channels.c:1999:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char s[36]; data/libssh-0.9.5/src/channels.c:2000: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 rnd[16]; data/libssh-0.9.5/src/channels.c:2734:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer_tmp[8192]; data/libssh-0.9.5/src/channels.c:2948: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(dest, ssh_buffer_get(stdbuf), len); data/libssh-0.9.5/src/channels.c:3396: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(readchans, rchans, (count_ptrs(rchans) + 1) * sizeof(ssh_channel )); data/libssh-0.9.5/src/channels.c:3397: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(writechans, wchans, (count_ptrs(wchans) + 1) * sizeof(ssh_channel )); data/libssh-0.9.5/src/channels.c:3398: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(exceptchans, echans, (count_ptrs(echans) + 1) * sizeof(ssh_channel )); data/libssh-0.9.5/src/client.c:180: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[256] = {0}; data/libssh-0.9.5/src/config.c:204: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 line[MAX_LINE_SIZE] = {0}; data/libssh-0.9.5/src/config.c:208:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(filename, "r"); data/libssh-0.9.5/src/config.c:352: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 com[512] = {0}; data/libssh-0.9.5/src/config.c:697:19: [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). switch (atoi(a)) { data/libssh-0.9.5/src/config.c:1016: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 line[MAX_LINE_SIZE] = {0}; data/libssh-0.9.5/src/config.c:1021:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(filename, "r"); data/libssh-0.9.5/src/connect.c:96:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[256]; data/libssh-0.9.5/src/connect.c:118:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char s_port[10]; data/libssh-0.9.5/src/connector.c:38: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). # undef open data/libssh-0.9.5/src/connector.c:39:11: [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). # define open _open data/libssh-0.9.5/src/connector.c:245: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 buffer[CHUNKSIZE]; data/libssh-0.9.5/src/connector.c:328: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 buffer[CHUNKSIZE]; data/libssh-0.9.5/src/curve25519.c:316: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(session->next_crypto->curve25519_server_pubkey, ssh_string_data(q_s_string), CURVE25519_PUBKEY_SIZE); data/libssh-0.9.5/src/curve25519.c:409: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(session->next_crypto->curve25519_client_pubkey, data/libssh-0.9.5/src/dh-gex.c:390: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 timestamp[32] = {0}; data/libssh-0.9.5/src/dh-gex.c:391: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 generator[32] = {0}; data/libssh-0.9.5/src/dh-gex.c:392: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 modulus[4096] = {0}; data/libssh-0.9.5/src/dh-gex.c:508:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). moduli = fopen(MODULI_FILE, "r"); data/libssh-0.9.5/src/external/bcrypt_pbkdf.c:131: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(countsalt, salt, saltlen); data/libssh-0.9.5/src/external/chacha.c:49:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char sigma[16] = "expand 32-byte k"; data/libssh-0.9.5/src/external/chacha.c:50:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char tau[16] = "expand 16-byte k"; data/libssh-0.9.5/src/external/curve25519_ref.c:9:23: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const unsigned char base[32] = {9}; data/libssh-0.9.5/src/external/curve25519_ref.c:130:59: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 mainloop(unsigned int work[64],const unsigned char e[32]) data/libssh-0.9.5/src/external/curve25519_ref.c:258: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 e[32]; data/libssh-0.9.5/src/external/ed25519.c:86: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 extsk[64]; data/libssh-0.9.5/src/external/ed25519.c:122: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 r[32]; data/libssh-0.9.5/src/external/ed25519.c:123: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 s[32]; data/libssh-0.9.5/src/external/ed25519.c:124: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 extsk[64]; data/libssh-0.9.5/src/external/ed25519.c:126: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 hmg[SHA512_DIGEST_LEN]; data/libssh-0.9.5/src/external/ed25519.c:127: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 hram[SHA512_DIGEST_LEN]; data/libssh-0.9.5/src/external/ed25519.c:184: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 t2[32]; data/libssh-0.9.5/src/external/ed25519.c:187: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 hram[SHA512_DIGEST_LEN]; data/libssh-0.9.5/src/external/fe25519.c:99: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 fe25519_unpack(fe25519 *r, const unsigned char x[32]) data/libssh-0.9.5/src/external/fe25519.c:111:28: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 fe25519_pack(unsigned char r[32], const fe25519 *x) data/libssh-0.9.5/src/external/ge25519.c:228:61: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 ge25519_unpackneg_vartime(ge25519_p3 *r, const unsigned char p[32]) data/libssh-0.9.5/src/external/ge25519.c:280:28: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 ge25519_pack(unsigned char r[32], const ge25519_p3 *p) data/libssh-0.9.5/src/external/ge25519.c:312: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 b[127]; data/libssh-0.9.5/src/external/ge25519.c:356: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. signed char b[85]; data/libssh-0.9.5/src/external/poly1305.c:30:24: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. poly1305_auth(unsigned char out[POLY1305_TAGLEN], const unsigned char *m, size_t inlen, const unsigned char key[POLY1305_KEYLEN]) { data/libssh-0.9.5/src/external/poly1305.c:30:66: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. poly1305_auth(unsigned char out[POLY1305_TAGLEN], const unsigned char *m, size_t inlen, const unsigned char key[POLY1305_KEYLEN]) { data/libssh-0.9.5/src/external/poly1305.c:30:104: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. poly1305_auth(unsigned char out[POLY1305_TAGLEN], const unsigned char *m, size_t inlen, const unsigned char key[POLY1305_KEYLEN]) { data/libssh-0.9.5/src/external/poly1305.c:41: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 mp[16]; data/libssh-0.9.5/src/external/sc25519.c:45: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 t[32]; data/libssh-0.9.5/src/external/sc25519.c:125:53: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 sc25519_from32bytes(sc25519 *r, const unsigned char x[32]) data/libssh-0.9.5/src/external/sc25519.c:140:63: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 shortsc25519_from16bytes(shortsc25519 *r, const unsigned char x[16]) data/libssh-0.9.5/src/external/sc25519.c:149:53: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 sc25519_from64bytes(sc25519 *r, const unsigned char x[64]) data/libssh-0.9.5/src/external/sc25519.c:173:33: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void sc25519_to32bytes(unsigned char r[32], const sc25519 *x) data/libssh-0.9.5/src/external/sc25519.c:286:29: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 sc25519_window3(signed char r[85], const sc25519 *s) data/libssh-0.9.5/src/external/sc25519.c:323:29: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 sc25519_window5(signed char r[51], const sc25519 *s) data/libssh-0.9.5/src/external/sc25519.c:360:36: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 sc25519_2interleave2(unsigned char r[127], data/libssh-0.9.5/src/getpass.c:238: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(&old_attr, &attr, sizeof(attr)); data/libssh-0.9.5/src/gssapi.c:236:42: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *oid_s = (unsigned char *) ssh_string_data(oids[i]); data/libssh-0.9.5/src/gssapi.c:298:42: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *oid_s = (unsigned char *) ssh_string_data(oids[i]); data/libssh-0.9.5/src/gssapi.c:322: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(session->gssapi->mech.elements, oid.elements, oid.length); data/libssh-0.9.5/src/gssapi.c:343: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(ptr, buffer.value, buffer.length); data/libssh-0.9.5/src/gssapi.c:721:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name_buf[256] = {0}; data/libssh-0.9.5/src/gssapi.c:780:20: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *)oids[i]->data)[0] = SSH_OID_TAG; data/libssh-0.9.5/src/gssapi.c:781:20: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *)oids[i]->data)[1] = selected->elements[i].length; data/libssh-0.9.5/src/gssapi.c:782: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((unsigned char *)oids[i]->data + 2, selected->elements[i].elements, data/libssh-0.9.5/src/gssapi.c:782:26: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. memcpy((unsigned char *)oids[i]->data + 2, selected->elements[i].elements, data/libssh-0.9.5/src/gssapi.c:830: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(ret->elements, &data[2], len-2); data/libssh-0.9.5/src/gzip.c:65: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 out_buf[BLOCKSIZE] = {0}; data/libssh-0.9.5/src/gzip.c:159: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 out_buf[BLOCKSIZE] = {0}; data/libssh-0.9.5/src/kdf.c:124: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 digest[DIGEST_MAX_LEN]; data/libssh-0.9.5/src/kdf.c:147: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(output, digest, output_len); data/libssh-0.9.5/src/kdf.c:159:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output + output_len, digest, requested_len - output_len); data/libssh-0.9.5/src/kdf.c:161:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output + output_len, digest, crypto->digest_len); data/libssh-0.9.5/src/kex.c:336: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 *strings[SSH_KEX_METHODS] = {0}; data/libssh-0.9.5/src/kex.c:1198: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(session->next_crypto->session_id, session->next_crypto->secret_hash, data/libssh-0.9.5/src/known_hosts.c:77: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[4096] = {0}; data/libssh-0.9.5/src/known_hosts.c:82:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). *file = fopen(filename,"r"); data/libssh-0.9.5/src/known_hosts.c:203: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 buffer[256] = {0}; data/libssh-0.9.5/src/known_hosts.c:296: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 *files[3]; data/libssh-0.9.5/src/known_hosts.c:514:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(session->opts.knownhosts, "a"); data/libssh-0.9.5/src/known_hosts.c:534:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(session->opts.knownhosts, "a"); data/libssh-0.9.5/src/knownhosts.c:78: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 hashed_buf[256] = {0}; data/libssh-0.9.5/src/knownhosts.c:219: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 line[8192]; data/libssh-0.9.5/src/knownhosts.c:225:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(filename, "r"); data/libssh-0.9.5/src/knownhosts.c:506: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 methods_buffer[256 + 1] = {0}; data/libssh-0.9.5/src/knownhosts.c:897: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 entry_buf[4096] = {0}; data/libssh-0.9.5/src/knownhosts.c:983:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(session->opts.knownhosts, "a"); data/libssh-0.9.5/src/knownhosts.c:1003:18: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(session->opts.knownhosts, "a"); data/libssh-0.9.5/src/legacy.c:582: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[1024]; data/libssh-0.9.5/src/legacy.c:583: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 host[256]; data/libssh-0.9.5/src/legacy.c:623:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(file, "w+"); data/libssh-0.9.5/src/libcrypto.c:684: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(cipher->aes_key->IV, IV, AES_BLOCK_SIZE); data/libssh-0.9.5/src/libcrypto.c:694: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 tmp_buffer[AES_BLOCK_SIZE]; data/libssh-0.9.5/src/libcrypto.c:732: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, in, len); data/libssh-0.9.5/src/libcrypto.c:777: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, in, aadlen); data/libssh-0.9.5/src/libcrypto.c:1113: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(&ssh_ciphertab[i], data/libssh-0.9.5/src/libgcrypt.c:77: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(md, gcry_md_read(c, 0), SHA_DIGEST_LEN); data/libssh-0.9.5/src/libgcrypt.c:133: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(md, gcry_md_read(ctx, algo), *mdlen); data/libssh-0.9.5/src/libgcrypt.c:151: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(md, gcry_md_read(c, 0), SHA256_DIGEST_LEN); data/libssh-0.9.5/src/libgcrypt.c:172: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(md, gcry_md_read(c, 0), SHA384_DIGEST_LEN); data/libssh-0.9.5/src/libgcrypt.c:193: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(md, gcry_md_read(c, 0), SHA512_DIGEST_LEN); data/libssh-0.9.5/src/libgcrypt.c:214: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(md, gcry_md_read(c, 0), MD5_DIGEST_LEN); data/libssh-0.9.5/src/libgcrypt.c:258: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(hashmacbuf, gcry_md_read(c, 0), *len); data/libssh-0.9.5/src/libgcrypt.c:350: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(cipher->last_iv, IV, AES_GCM_IVLEN); data/libssh-0.9.5/src/libgcrypt.c:389: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, in, len); data/libssh-0.9.5/src/libgcrypt.c:435: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, in, aadlen); data/libssh-0.9.5/src/libgcrypt.c:787: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(&ssh_ciphertab[i], data/libssh-0.9.5/src/libmbedcrypto.c:585: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(cipher->last_iv, IV, AES_GCM_IVLEN); data/libssh-0.9.5/src/libmbedcrypto.c:804: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, in, len); data/libssh-0.9.5/src/libmbedcrypto.c:826: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, in, aadlen); data/libssh-0.9.5/src/libmbedcrypto.c:1057: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(&ssh_ciphertab[i], data/libssh-0.9.5/src/log.c:56:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tbuf[64]; data/libssh-0.9.5/src/log.c: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 date[128] = {0}; data/libssh-0.9.5/src/log.c:103: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[1024]; data/libssh-0.9.5/src/log.c:121:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1024]; data/libssh-0.9.5/src/log.c:138:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1024]; data/libssh-0.9.5/src/log.c:160: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[1024]; data/libssh-0.9.5/src/match.c:132:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sub[1024]; data/libssh-0.9.5/src/misc.c:108:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[MAX_PATH] = {0}; data/libssh-0.9.5/src/misc.c:246: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[NSS_BUFLEN_PASSWD] = {0}; data/libssh-0.9.5/src/misc.c:304: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[NSS_BUFLEN_PASSWD]; data/libssh-0.9.5/src/misc.c:470: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 ascii[17]; data/libssh-0.9.5/src/misc.c:492: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[80]; data/libssh-0.9.5/src/misc.c:1056: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 u[128]; data/libssh-0.9.5/src/misc.c:1061: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(u, d, s); data/libssh-0.9.5/src/misc.c:1087: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(r, h, lh); data/libssh-0.9.5/src/misc.c:1090: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(r + lh, p, ld + 1); data/libssh-0.9.5/src/misc.c:1107: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 host[NI_MAXHOST]; data/libssh-0.9.5/src/misc.c:1108: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[MAX_BUF_SIZE]; data/libssh-0.9.5/src/misc.c:1168: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 tmp[6]; data/libssh-0.9.5/src/misc.c:1491: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(x, s, n); data/libssh-0.9.5/src/options.c:1253: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 optv[3] = "- "; data/libssh-0.9.5/src/options.c:2008: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[MAX_BUF_SIZE]; data/libssh-0.9.5/src/packet.c:1259: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(cleartext_packet, data/libssh-0.9.5/src/packet.c:1926: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(session->next_crypto->session_id, data/libssh-0.9.5/src/packet_crypt.c:79: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(destination, source, 8); data/libssh-0.9.5/src/packet_crypt.c:178: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(data, out, len); data/libssh-0.9.5/src/packet_crypt.c:193: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((uint8_t*)data + etm_packet_offset, out, len - etm_packet_offset); data/libssh-0.9.5/src/packet_crypt.c:246: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 hmacbuf[DIGEST_MAX_LEN] = {0}; data/libssh-0.9.5/src/pcap.c:212:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). pcap->output=fopen(filename,"wb"); data/libssh-0.9.5/src/pki.c:46: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). # undef open data/libssh-0.9.5/src/pki.c:47:11: [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). # define open _open data/libssh-0.9.5/src/pki.c:865:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(filename, "rb"); data/libssh-0.9.5/src/pki.c:958:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(filename, "wb"); data/libssh-0.9.5/src/pki.c:1348: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(key->ed25519_pubkey, ssh_string_data(pubkey), ED25519_KEY_LEN); data/libssh-0.9.5/src/pki.c:1599:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(filename, "rb"); data/libssh-0.9.5/src/pki.c:1945: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 key_buf[4096]; data/libssh-0.9.5/src/pki.c:1946: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 host[256]; data/libssh-0.9.5/src/pki.c:1985:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(filename, "wb+"); data/libssh-0.9.5/src/pki_container_openssh.c:112: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 passphrase_buffer[128] = {0}; data/libssh-0.9.5/src/pki_container_openssh.c:445: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 passphrase_buffer[128] = {0}; data/libssh-0.9.5/src/pki_container_openssh.c:639: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(ssh_string_data(kdf_options), data/libssh-0.9.5/src/pki_crypto.c:1374: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[40] = { 0 }; data/libssh-0.9.5/src/pki_crypto.c:1426: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(buffer + r_offset_out, data/libssh-0.9.5/src/pki_crypto.c:1429: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(buffer + 20 + s_offset_out, data/libssh-0.9.5/src/pki_crypto.c:1624: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(blob_padded_data + pad_len, blob_orig, len); data/libssh-0.9.5/src/pki_ed25519.c:92: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(sig->ed25519_sig, buffer, ED25519_SIG_LEN); data/libssh-0.9.5/src/pki_ed25519.c:126: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(buffer, sig->ed25519_sig, ED25519_SIG_LEN); data/libssh-0.9.5/src/pki_ed25519.c:127: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(buffer + ED25519_SIG_LEN, hash, hlen); data/libssh-0.9.5/src/pki_ed25519_common.c:60: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(key->ed25519_privkey, ssh_string_data(privkey), data/libssh-0.9.5/src/pki_ed25519_common.c:63: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(key->ed25519_privkey, ssh_string_data(privkey), data/libssh-0.9.5/src/pki_ed25519_common.c:66: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(key->ed25519_pubkey, ssh_string_data(pubkey), data/libssh-0.9.5/src/pki_ed25519_common.c:160: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(new->ed25519_privkey, key->ed25519_privkey, ED25519_KEY_LEN); data/libssh-0.9.5/src/pki_ed25519_common.c:162: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(new->ed25519_privkey, key->ed25519_privkey, 2 * ED25519_KEY_LEN); data/libssh-0.9.5/src/pki_ed25519_common.c:172: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(new->ed25519_pubkey, key->ed25519_pubkey, ED25519_KEY_LEN); data/libssh-0.9.5/src/pki_ed25519_common.c:275: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(sig->ed25519_sig, ssh_string_data(sig_blob), ED25519_SIG_LEN); data/libssh-0.9.5/src/pki_gcrypt.c:101: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 tmp[4]; data/libssh-0.9.5/src/pki_gcrypt.c:253: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 digest[MD5_DIGEST_LEN] = {0}; data/libssh-0.9.5/src/pki_gcrypt.c:292:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char passphrase[MAX_PASSPHRASE_SIZE] = {0}; data/libssh-0.9.5/src/pki_gcrypt.c:293: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 key[MAX_KEY_SIZE] = {0}; data/libssh-0.9.5/src/pki_gcrypt.c:325: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(ssh_buffer_get(data), tmp, ssh_buffer_get_len(data)); data/libssh-0.9.5/src/pki_gcrypt.c:1757: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[40] = { 0 }; data/libssh-0.9.5/src/pki_gcrypt.c:1785: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(buffer + r_offset_out, data/libssh-0.9.5/src/pki_gcrypt.c:1804: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(buffer + 20 + s_offset_out, data/libssh-0.9.5/src/pki_gcrypt.c:2097: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 ghash[hlen + 1]; data/libssh-0.9.5/src/pki_gcrypt.c:2114: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(ghash + 1, hash, hlen); data/libssh-0.9.5/src/pki_gcrypt.c:2224:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash[SHA512_DIGEST_LEN] = {0}; data/libssh-0.9.5/src/pki_gcrypt.c:2301: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 ghash[SHA512_DIGEST_LEN + 1] = {0}; data/libssh-0.9.5/src/pki_mbedcrypto.c:94: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 tmp[MAX_PASSPHRASE_SIZE] = {0}; data/libssh-0.9.5/src/pki_mbedcrypto.c:137: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 error_buf[100]; data/libssh-0.9.5/src/pki_mbedcrypto.c:178: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 error_buf[100]; data/libssh-0.9.5/src/pki_mbedcrypto.c:897: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(blob_padded_data + pad_len, blob_orig, len); data/libssh-0.9.5/src/pki_mbedcrypto.c:1171:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash[SHA512_DIGEST_LEN] = {0}; data/libssh-0.9.5/src/pki_mbedcrypto.c:1245:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash[SHA512_DIGEST_LEN] = {0}; data/libssh-0.9.5/src/pki_mbedcrypto.c:1314: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 error_buf[100]; data/libssh-0.9.5/src/pki_mbedcrypto.c:1330: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 error_buf[100]; data/libssh-0.9.5/src/poll.c:173: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 data[64] = {0}; data/libssh-0.9.5/src/scp.c:122: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 execbuffer[1024] = {0}; data/libssh-0.9.5/src/scp.c:243: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[128] = {0}; data/libssh-0.9.5/src/scp.c:322: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[1024] = {0}; data/libssh-0.9.5/src/scp.c:459: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[1024] = {0}; data/libssh-0.9.5/src/scp.c:578: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 msg[128] = {0}; data/libssh-0.9.5/src/scp.c:772: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[MAX_BUF_SIZE] = {0}; data/libssh-0.9.5/src/scp.c:884: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[MAX_BUF_SIZE] = {0}; data/libssh-0.9.5/src/scp.c:1097: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[16] = {0}; data/libssh-0.9.5/src/server.c:90: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 hostkeys[128] = {0}; data/libssh-0.9.5/src/server.c:571:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char methods_c[128] = {0}; data/libssh-0.9.5/src/sftp.c:1991: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(buf, ssh_string_data(datastring), datalen); data/libssh-0.9.5/src/sftp.c:2115: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(data, ssh_string_data(datastring), len); data/libssh-0.9.5/src/sftpserver.c:522: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(ssh_string_data(ret), &val, sizeof(uint32_t)); data/libssh-0.9.5/src/sftpserver.c:539: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(&val, ssh_string_data(handle), sizeof(uint32_t)); data/libssh-0.9.5/src/socket.c:33:8: [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). #undef open data/libssh-0.9.5/src/socket.c:34: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). #define open _open data/libssh-0.9.5/src/socket.c:236: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[MAX_BUF_SIZE]; data/libssh-0.9.5/src/socket.c:874: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). int devnull = open("/dev/null", O_WRONLY); data/libssh-0.9.5/src/string.c:93: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(s->data, data, len); data/libssh-0.9.5/src/string.c:124: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(ptr->data, what, len); data/libssh-0.9.5/src/string.c:198: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(new, s->data, len); data/libssh-0.9.5/src/string.c:239: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(new->data, s->data, len); data/libssh-0.9.5/src/token.c:248: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(&ret[pos], a_tok->tokens[j], len); data/libssh-0.9.5/src/wrapper.c:117: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(cipher, &ssh_get_ciphertab()[offset], sizeof(*cipher)); data/libssh-0.9.5/tests/authentication.c:18: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[128]; data/libssh-0.9.5/tests/benchmarks/bench_raw.c:50:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[12]; data/libssh-0.9.5/tests/benchmarks/bench_raw.c:52: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(eater,python_eater,sizeof(python_eater)); data/libssh-0.9.5/tests/benchmarks/bench_raw.c:58:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"0x%.8lx",bytes); data/libssh-0.9.5/tests/benchmarks/bench_raw.c:59: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(ptr,buf,10); data/libssh-0.9.5/tests/benchmarks/bench_raw.c:74:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[128]; data/libssh-0.9.5/tests/benchmarks/bench_raw.c:111:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[128]; data/libssh-0.9.5/tests/benchmarks/bench_raw.c:206:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[12]; data/libssh-0.9.5/tests/benchmarks/bench_raw.c:208: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(giver,python_giver,sizeof(python_giver)); data/libssh-0.9.5/tests/benchmarks/bench_raw.c:214:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"0x%.8lx",bytes); data/libssh-0.9.5/tests/benchmarks/bench_raw.c:215: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(ptr,buf,10); data/libssh-0.9.5/tests/benchmarks/bench_raw.c:231:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[128]; data/libssh-0.9.5/tests/benchmarks/benchmarks.c:218: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). arguments->datasize = atoi(arg); data/libssh-0.9.5/tests/benchmarks/benchmarks.c:221:40: [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). arguments->concurrent_requests = atoi(arg); data/libssh-0.9.5/tests/benchmarks/benchmarks.c:224:30: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). arguments->chunksize = atoi(arg); data/libssh-0.9.5/tests/benchmarks/benchmarks.c:302:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[128]; data/libssh-0.9.5/tests/benchmarks/benchmarks.h:44: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. const char *hosts[MAX_HOSTS_CONNECT]; data/libssh-0.9.5/tests/benchmarks/latency.c:44:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[256]; data/libssh-0.9.5/tests/benchmarks/latency.c:45:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[1024]; data/libssh-0.9.5/tests/chmodtest.c:10:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1024*1024]; data/libssh-0.9.5/tests/client/torture_algorithms.c:88: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 data[256]; data/libssh-0.9.5/tests/client/torture_auth.c:112: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 ssh_agent_cmd[4096]; data/libssh-0.9.5/tests/client/torture_auth.c:113: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 ssh_agent_sock[1024]; data/libssh-0.9.5/tests/client/torture_auth.c:114: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 ssh_agent_pidfile[1024]; data/libssh-0.9.5/tests/client/torture_auth.c:115:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char bob_ssh_key[1024]; data/libssh-0.9.5/tests/client/torture_auth.c:165: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 bob_alt_ssh_key[1024]; data/libssh-0.9.5/tests/client/torture_auth.c:509: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 bob_ssh_key[1024]; data/libssh-0.9.5/tests/client/torture_auth.c:510: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 bob_ssh_cert[2048]; data/libssh-0.9.5/tests/client/torture_auth.c:682: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 bob_ssh_key[1024]; data/libssh-0.9.5/tests/client/torture_auth.c:834: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 bob_ssh_key[1024]; data/libssh-0.9.5/tests/client/torture_knownhosts.c:100: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_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts.c:102: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[200]; data/libssh-0.9.5/tests/client/torture_knownhosts.c:127:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(known_hosts_file, "r"); data/libssh-0.9.5/tests/client/torture_knownhosts.c:158: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_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts.c:173:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(known_hosts_file, "w"); data/libssh-0.9.5/tests/client/torture_knownhosts.c:196: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_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts.c:211:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(known_hosts_file, "w"); data/libssh-0.9.5/tests/client/torture_knownhosts.c:233: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_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts.c:253:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(known_hosts_file, "w"); data/libssh-0.9.5/tests/client/torture_knownhosts.c:270: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_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts.c:290:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(known_hosts_file, "w"); data/libssh-0.9.5/tests/client/torture_knownhosts.c:307: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_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts.c:371: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_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts.c:395:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(known_hosts_file, "w"); data/libssh-0.9.5/tests/client/torture_knownhosts.c:442: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_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts_verify.c:154: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_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts_verify.c:168:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(known_hosts_file, "w"); data/libssh-0.9.5/tests/client/torture_knownhosts_verify.c:224:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts_verify.c:238:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(known_hosts_file, "w"); data/libssh-0.9.5/tests/client/torture_knownhosts_verify.c:276: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_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts_verify.c:297:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(known_hosts_file, "w"); data/libssh-0.9.5/tests/client/torture_knownhosts_verify.c:316: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_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts_verify.c:380: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_file[1024] = {0}; data/libssh-0.9.5/tests/client/torture_knownhosts_verify.c:395:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(known_hosts_file, "w"); data/libssh-0.9.5/tests/client/torture_knownhosts_verify.c:453: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_known_hosts[256]; data/libssh-0.9.5/tests/client/torture_proxycommand.c:69:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char command[255] = {0}; data/libssh-0.9.5/tests/client/torture_proxycommand.c:120: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 command[255] = {0}; data/libssh-0.9.5/tests/client/torture_proxycommand.c:144: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 command[255] = {0}; data/libssh-0.9.5/tests/client/torture_rekey.c:154: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 data[256]; data/libssh-0.9.5/tests/client/torture_rekey.c:178: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(secret_hash, c->secret_hash, c->digest_len); data/libssh-0.9.5/tests/client/torture_rekey.c:266: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[MAX_XFER_BUF_SIZE]; data/libssh-0.9.5/tests/client/torture_rekey.c:283: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(secret_hash, c->secret_hash, c->digest_len); data/libssh-0.9.5/tests/client/torture_rekey.c:290:10: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp(libssh_tmp_file); data/libssh-0.9.5/tests/client/torture_rekey.c:328: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 data[256]; data/libssh-0.9.5/tests/client/torture_rekey.c:346: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(secret_hash, c->secret_hash, c->digest_len); data/libssh-0.9.5/tests/client/torture_rekey.c:397: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 data[256]; data/libssh-0.9.5/tests/client/torture_rekey.c:412: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(secret_hash, c->secret_hash, c->digest_len); data/libssh-0.9.5/tests/client/torture_rekey.c:462: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[MAX_XFER_BUF_SIZE]; data/libssh-0.9.5/tests/client/torture_rekey.c:473: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(secret_hash, c->secret_hash, c->digest_len); data/libssh-0.9.5/tests/client/torture_rekey.c:480:10: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp(libssh_tmp_file); data/libssh-0.9.5/tests/client/torture_request_env.c:83:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[4096] = {0}; data/libssh-0.9.5/tests/client/torture_scp.c:158: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 expected_a[BUF_SIZE]; data/libssh-0.9.5/tests/client/torture_scp.c:159: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[BUF_SIZE]; data/libssh-0.9.5/tests/client/torture_scp.c:203:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(buf, "r"); data/libssh-0.9.5/tests/client/torture_scp.c:221: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 expected_b[BUF_SIZE]; data/libssh-0.9.5/tests/client/torture_scp.c:222: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[BUF_SIZE]; data/libssh-0.9.5/tests/client/torture_scp.c:275:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(buf, "r"); data/libssh-0.9.5/tests/client/torture_scp.c:293: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 expected_a[BUF_SIZE]; data/libssh-0.9.5/tests/client/torture_scp.c:294: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[BUF_SIZE]; data/libssh-0.9.5/tests/client/torture_scp.c:325: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). fd = open(buf, O_WRONLY | O_CREAT, 0644); data/libssh-0.9.5/tests/client/torture_scp.c:379: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 expected_b[BUF_SIZE]; data/libssh-0.9.5/tests/client/torture_scp.c:380: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[BUF_SIZE]; data/libssh-0.9.5/tests/client/torture_scp.c:407: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). fd = open(buf, O_WRONLY | O_CREAT, 0644); data/libssh-0.9.5/tests/client/torture_scp.c:485: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/libssh-0.9.5/tests/client/torture_scp.c:534:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(buf, "r"); data/libssh-0.9.5/tests/client/torture_scp.c:554: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/libssh-0.9.5/tests/client/torture_scp.c:606:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(buf, "r"); data/libssh-0.9.5/tests/client/torture_scp.c:614:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(buf, "r"); data/libssh-0.9.5/tests/client/torture_session.c:36:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[BUFLEN]; data/libssh-0.9.5/tests/client/torture_sftp_benchmark.c:75: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 local_path[1024] = {0}; data/libssh-0.9.5/tests/client/torture_sftp_dir.c: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 tmpdir[128] = {0}; data/libssh-0.9.5/tests/client/torture_sftp_fsync.c:69:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAX_XFER_BUF_SIZE] = {0}; data/libssh-0.9.5/tests/client/torture_sftp_fsync.c:70: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_verify[MAX_XFER_BUF_SIZE] = {0}; data/libssh-0.9.5/tests/client/torture_sftp_fsync.c:82:10: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp(libssh_tmp_file); data/libssh-0.9.5/tests/client/torture_sftp_fsync.c:103:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(libssh_tmp_file, "r"); data/libssh-0.9.5/tests/client/torture_sftp_read.c:69:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAX_XFER_BUF_SIZE]; data/libssh-0.9.5/tests/client/torture_sftp_read.c:80:10: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp(libssh_tmp_file); data/libssh-0.9.5/tests/fuzz/ssh_server_fuzzer.cpp:69:14: [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). int fd = open("/tmp/libssh_fuzzer_private_key", O_WRONLY | O_CREAT, S_IRWXU); data/libssh-0.9.5/tests/pkd/pkd_hello.c:94:37: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). pkd_dargs.opts.iterations = atoi(arg); data/libssh-0.9.5/tests/pkd/pkd_hello.c:103:38: [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). pkd_dargs.rekey_data_limit = atoi(arg); data/libssh-0.9.5/tests/pkd/pkd_hello.c:588: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 logfile[1024] = { 0 }; data/libssh-0.9.5/tests/pkd/pkd_hello.c:613: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 testcmd[2048] = { 0 }; \ data/libssh-0.9.5/tests/pkd/pkd_hello.c:853: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(&all_tests[tindex], &openssh_fips_tests[0], sizeof(openssh_fips_tests)); data/libssh-0.9.5/tests/pkd/pkd_hello.c:856: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(&all_tests[tindex], &openssh_tests[0], sizeof(openssh_tests)); data/libssh-0.9.5/tests/pkd/pkd_hello.c:864: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(&all_tests[tindex], &dropbear_tests[0], sizeof(dropbear_tests)); data/libssh-0.9.5/tests/pkd/pkd_hello.c:869: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(&all_tests[tindex], &noop_tests[0], sizeof(noop_tests)); data/libssh-0.9.5/tests/pkd/pkd_hello.c:887: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(&matching_tests[0], data/libssh-0.9.5/tests/pkd/pkd_hello.c:896: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(&matching_tests[num_found], data/libssh-0.9.5/tests/pkd/pkd_hello.c:970: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 bin[1024] = { 0 }; data/libssh-0.9.5/tests/pkd/pkd_util.c:38: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 bin[1024] = { 0 }; data/libssh-0.9.5/tests/pkd/pkd_util.c:46: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 version_buff[1024] = { 0 }; data/libssh-0.9.5/tests/server/test_server/default_cb.c:700: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[BUF_SIZE]; data/libssh-0.9.5/tests/server/test_server/default_cb.c:716: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[BUF_SIZE]; data/libssh-0.9.5/tests/server/test_server/main.c:207: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). state->port = atoi(arguments->port); data/libssh-0.9.5/tests/server/test_server/main.c:272: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). state->verbosity = atoi(arguments->verbosity); data/libssh-0.9.5/tests/server/test_server/main.c:278:31: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). state->auth_methods = atoi(arguments->auth_methods); data/libssh-0.9.5/tests/server/test_server/test_server.c:284: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 err_str[1024] = {0}; data/libssh-0.9.5/tests/server/torture_server.c:59: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 dsa_hostkey[1024]; data/libssh-0.9.5/tests/server/torture_server.c:62: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 ed25519_hostkey[1024] = {0}; data/libssh-0.9.5/tests/server/torture_server.c:63: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 rsa_hostkey[1024]; data/libssh-0.9.5/tests/server/torture_server.c:64: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 ecdsa_hostkey[1024]; data/libssh-0.9.5/tests/server/torture_server.c:67: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 sshd_path[1024]; data/libssh-0.9.5/tests/server/torture_server.c:83:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pid_str[1024]; data/libssh-0.9.5/tests/server/torture_server.c:431: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 known_hosts_file[1024] = {0}; data/libssh-0.9.5/tests/server/torture_server.c:451:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(known_hosts_file, "w"); data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:110: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[BUF_SIZE]; data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:126:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BUF_SIZE]; data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:153: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. const char *initial_prompt[2]; data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:154: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. const char *retype_prompt[1]; data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:523: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 rsa_hostkey[1024] = {0}; data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:525: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 sshd_path[1024]; data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:529: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 pid_str[1024]; data/libssh-0.9.5/tests/server/torture_server_config.c:50:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ed25519_hostkey[1024]; data/libssh-0.9.5/tests/server/torture_server_config.c:51: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 rsa_hostkey[1024]; data/libssh-0.9.5/tests/server/torture_server_config.c:52: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 ecdsa_521_hostkey[1024]; data/libssh-0.9.5/tests/server/torture_server_config.c:53: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 ecdsa_384_hostkey[1024]; data/libssh-0.9.5/tests/server/torture_server_config.c:54:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ecdsa_256_hostkey[1024]; data/libssh-0.9.5/tests/server/torture_server_config.c:56:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dsa_hostkey[1024]; data/libssh-0.9.5/tests/server/torture_server_config.c:64: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 sshd_path[1024]; data/libssh-0.9.5/tests/server/torture_server_config.c:246: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 pid_str[1024]; data/libssh-0.9.5/tests/server/torture_server_config.c:356: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 config_file[1024]; data/libssh-0.9.5/tests/server/torture_server_config.c:425:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char *hostkey_files[6] = {0}; data/libssh-0.9.5/tests/server/torture_server_config.c:457: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 config_content[4096]; data/libssh-0.9.5/tests/server/torture_server_config.c:480: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 config_content[4096]; data/libssh-0.9.5/tests/server/torture_server_config.c:535: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 config_content[4096]; data/libssh-0.9.5/tests/server/torture_server_config.c:590: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 config_content[4096]; data/libssh-0.9.5/tests/server/torture_server_config.c:645: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 config_content[4096]; data/libssh-0.9.5/tests/server/torture_server_config.c:758: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 config_content[4096]; data/libssh-0.9.5/tests/sftp_stress/main.c:19:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 samplefile[FILESIZE]; data/libssh-0.9.5/tests/sftp_stress/main.c:141:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[128]; data/libssh-0.9.5/tests/test_exec.c:11:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[4096] = {0}; data/libssh-0.9.5/tests/test_socket.c:85:34: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if(ssh_socket_connect(s,argv[1],atoi(argv[2]),NULL) != SSH_OK){ data/libssh-0.9.5/tests/test_tunnel.c:33:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char string[20]; data/libssh-0.9.5/tests/test_tunnel.c:34:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[20]; data/libssh-0.9.5/tests/test_tunnel.c:36:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(string,"%d\n",i); data/libssh-0.9.5/tests/torture.c:45: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). #define open _open data/libssh-0.9.5/tests/torture.c:201: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[8] = {0}; data/libssh-0.9.5/tests/torture.c:207: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). fd = open(pidfile, O_RDONLY); data/libssh-0.9.5/tests/torture.c:492: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 port = atoi(env); data/libssh-0.9.5/tests/torture.c:594: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 ed25519_hostkey[1024] = {0}; data/libssh-0.9.5/tests/torture.c:596: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 dsa_hostkey[1024]; data/libssh-0.9.5/tests/torture.c:598: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 rsa_hostkey[1024]; data/libssh-0.9.5/tests/torture.c:599: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 ecdsa_hostkey[1024]; data/libssh-0.9.5/tests/torture.c:600: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 trusted_ca_pubkey[1024]; data/libssh-0.9.5/tests/torture.c:601: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 sshd_config[4096]; data/libssh-0.9.5/tests/torture.c:602: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 sshd_path[1024]; data/libssh-0.9.5/tests/torture.c:839: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 sshd_start_cmd[1024]; data/libssh-0.9.5/tests/torture.c:1003:10: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp(new_file); data/libssh-0.9.5/tests/torture.c:1049: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_dir_path[MAX_PATH]; data/libssh-0.9.5/tests/torture.c:1050: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_file_name[MAX_PATH]; data/libssh-0.9.5/tests/torture.c:1120: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 file_path[MAX_PATH]; data/libssh-0.9.5/tests/torture.c:1126:5: [2] (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 string. strcat(file_path, "\\*"); data/libssh-0.9.5/tests/torture.c:1228: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_dir_path[MAX_PATH]; data/libssh-0.9.5/tests/torture.c:1229: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_file_name[MAX_PATH]; data/libssh-0.9.5/tests/torture.c:1332: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). fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, 0600); data/libssh-0.9.5/tests/torture.c:1358: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). verbosity = atoi(env); data/libssh-0.9.5/tests/torture_cmocka.c:35:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ssh_error[1024] = {0}; data/libssh-0.9.5/tests/torture_cmocka.c:60: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 ssh_error[1024] = {0}; data/libssh-0.9.5/tests/torture_cmocka.c:85: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 ssh_error[1024] = {0}; data/libssh-0.9.5/tests/torture_pki.c:15: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). #define open _open data/libssh-0.9.5/tests/torture_pki.c:34: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). fd = open(filename, O_RDONLY); data/libssh-0.9.5/tests/torture_pki.c:67:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(filename, "r"); data/libssh-0.9.5/tests/unittests/torture_buffer.c:110:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char data[128]; data/libssh-0.9.5/tests/unittests/torture_channel.c:24: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). fd = open("/dev/null", 0); data/libssh-0.9.5/tests/unittests/torture_config.c:446: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 config[1024]; data/libssh-0.9.5/tests/unittests/torture_crypto.c:52: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(cipher, &ciphers[i], sizeof(*cipher)); data/libssh-0.9.5/tests/unittests/torture_crypto.c:74: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(iv, IV, sizeof(IV)); data/libssh-0.9.5/tests/unittests/torture_crypto.c:95: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(iv, IV, sizeof(IV)); data/libssh-0.9.5/tests/unittests/torture_keyfiles.c:140:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(filename, "r"); data/libssh-0.9.5/tests/unittests/torture_keyfiles.c:163: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 pubkey_line_orig[512] = {0}; data/libssh-0.9.5/tests/unittests/torture_keyfiles.c:164:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pubkey_line_new[512] = {0}; data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c:45:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(tmp_file, "w"); data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c:90:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(tmp_file, "w"); data/libssh-0.9.5/tests/unittests/torture_misc.c:125: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 h[256]; data/libssh-0.9.5/tests/unittests/torture_misc.c:372: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[256]; data/libssh-0.9.5/tests/unittests/torture_misc.c:383:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(buffer, "w"); data/libssh-0.9.5/tests/unittests/torture_misc.c:416: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[256]; data/libssh-0.9.5/tests/unittests/torture_misc.c:506: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[2048]; data/libssh-0.9.5/tests/unittests/torture_misc.c:643: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[1024]; data/libssh-0.9.5/tests/unittests/torture_moduli.c:79:20: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). FILE *moduli = tmpfile(); data/libssh-0.9.5/tests/unittests/torture_options.c:367: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[NSS_BUFLEN_PASSWD]; data/libssh-0.9.5/tests/unittests/torture_options.c:534:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_options.c:585:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_options.c:596:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_options.c:607:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_options.c:618:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_options.c:629:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_options.c:640:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_options.c:657:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_options.c:674:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_options.c:696:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_options.c:713:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_options.c:730:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_options.c:767:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). config = fopen("test_config", "w"); data/libssh-0.9.5/tests/unittests/torture_packet.c:26: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(ret, data, len); data/libssh-0.9.5/tests/unittests/torture_pki_dsa.c:701: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 pubkey_generated[4096] = {0}; data/libssh-0.9.5/tests/unittests/torture_pki_ecdsa.c:397: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 pubkey_original[4096] = {0}; data/libssh-0.9.5/tests/unittests/torture_pki_ecdsa.c:398: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 pubkey_generated[4096] = {0}; data/libssh-0.9.5/tests/unittests/torture_pki_ed25519.c:378: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 pubkey_generated[4096] = {0}; data/libssh-0.9.5/tests/unittests/torture_pki_rsa.c:444: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 pubkey_generated[4096] = {0}; data/libssh-0.9.5/tests/unittests/torture_rand.c:41: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[12]; data/libssh-0.9.5/tests/unittests/torture_server_x11.c:38:13: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). h->fd = mkstemp(h->hostkey_path); data/libssh-0.9.5/tests/unittests/torture_temp_file.c:43:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(file_name, "r"); data/libssh-0.9.5/tests/unittests/torture_threads_buffer.c:228: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 data[128] = {0}; data/libssh-0.9.5/tests/unittests/torture_threads_crypto.c:99: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(cipher, &ciphers[i], sizeof(*cipher)); data/libssh-0.9.5/tests/unittests/torture_threads_crypto.c:130: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(iv, IV, sizeof(IV)); data/libssh-0.9.5/tests/unittests/torture_threads_crypto.c:158: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(iv, IV, sizeof(IV)); data/libssh-0.9.5/debian/tests/mock-sshd.c:184:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes = read (fd, buf, ws); data/libssh-0.9.5/examples/authentication.c:42:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (name && strlen(name) > 0) { data/libssh-0.9.5/examples/authentication.c:46:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (instruction && strlen(instruction) > 0) { data/libssh-0.9.5/examples/authentication.c:78:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memset(buffer, 0, strlen(buffer)); data/libssh-0.9.5/examples/proxy.c:286:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ssh_channel_write(chan,buf,strlen(buf)); data/libssh-0.9.5/examples/proxy.c:292:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ssh_channel_write(chan, buf, strlen(buf)); data/libssh-0.9.5/examples/proxy.c:297:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(strlen(host) + i < sizeof(host)){ data/libssh-0.9.5/examples/proxy.c:298:17: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(host, buf, i); data/libssh-0.9.5/examples/proxy.c:311:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ssh_channel_write(chan, buf, strlen(buf)); data/libssh-0.9.5/examples/proxy.c:340:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ssh_channel_write(chan,buf,strlen(buf)); data/libssh-0.9.5/examples/ssh_server_fork.c:194:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(authorizedkeys, arg, DEF_STR_SIZE-1); data/libssh-0.9.5/examples/ssh_server_fork.c:512:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, buf, BUF_SIZE); data/libssh-0.9.5/examples/ssh_server_fork.c:527:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, buf, BUF_SIZE); data/libssh-0.9.5/examples/sshnetcat.c:115:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). lus=read(0,buffer,sizeof(buffer)); data/libssh-0.9.5/include/libssh/libsshpp.hpp:545:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(void *dest, size_t count){ data/libssh-0.9.5/include/libssh/libsshpp.hpp:554:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(void *dest, size_t count, int timeout){ data/libssh-0.9.5/include/libssh/libsshpp.hpp:563:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(void *dest, size_t count, bool is_stderr=false, int timeout=-1){ data/libssh-0.9.5/include/libssh/priv.h:116:11: [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)/1000) data/libssh-0.9.5/src/agent.c:82:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). res = read(fd, b + pos, n - pos); data/libssh-0.9.5/src/auth.c:1355:49: [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). explicit_bzero(kbd->prompts[i], strlen(kbd->prompts[i])); data/libssh-0.9.5/src/auth.c:1366:49: [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). explicit_bzero(kbd->answers[i], strlen(kbd->answers[i])); data/libssh-0.9.5/src/auth.c:1390:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). explicit_bzero(kbd->prompts[i], strlen(kbd->prompts[i])); data/libssh-0.9.5/src/auth.c:1400:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). explicit_bzero(kbd->answers[i], strlen(kbd->answers[i])); data/libssh-0.9.5/src/auth.c:1872:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(session->kbdint->answers[i])); data/libssh-0.9.5/src/base64.c:92:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(ptr); data/libssh-0.9.5/src/bind_config.c:301:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (len = strlen(s) - 1; len > 0; len--) { data/libssh-0.9.5/src/buffer.c:858:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). needed_size += sizeof(uint32_t) + strlen(cstring); data/libssh-0.9.5/src/buffer.c:877:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). needed_size += strlen(cstring); data/libssh-0.9.5/src/buffer.c:977:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(cstring); data/libssh-0.9.5/src/buffer.c:1005:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(cstring); data/libssh-0.9.5/src/buffer.c:1308:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). explicit_bzero(*o.cstring, strlen(*o.cstring)); data/libssh-0.9.5/src/client.c:191:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(session->opts.custombanner); data/libssh-0.9.5/src/client.c:220:52: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). rc = ssh_socket_write(session->socket, buffer, strlen(buffer)); data/libssh-0.9.5/src/client.c:229:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(buffer), data/libssh-0.9.5/src/client.c:230:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(buffer)); data/libssh-0.9.5/src/config.c:278:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ok = match_pattern_list(value, pattern, strlen(pattern), 0); data/libssh-0.9.5/src/config.c:409: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). for (len = strlen(s) - 1; len > 0; len--) { data/libssh-0.9.5/src/config.c:614: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). ok = match_hostname(lowerhost, p, strlen(p)); data/libssh-0.9.5/src/connector.c:42:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # undef read data/libssh-0.9.5/src/connector.c:43:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # define read _read data/libssh-0.9.5/src/connector.c:722:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nread = read(connector->in_fd,buffer, len); data/libssh-0.9.5/src/dh-gex.c:401:21: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). firstbyte = getc(moduli); data/libssh-0.9.5/src/dh-gex.c:404:29: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). firstbyte = getc(moduli); data/libssh-0.9.5/src/dh-gex.c:412:14: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. rc = fscanf(moduli, data/libssh-0.9.5/src/dh-gex.c:427:29: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). firstbyte = getc(moduli); data/libssh-0.9.5/src/dh.c:689: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). for (k = strlen(b64_padded); k != 0 && b64_padded[k-1] == '='; k--); data/libssh-0.9.5/src/dh.c:752:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). str_len = strlen(prefix); data/libssh-0.9.5/src/dh.c:753:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (str_len + 1 + strlen(fingerprint) + 1 < str_len) { data/libssh-0.9.5/src/dh.c:757:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). str_len += 1 + strlen(fingerprint) + 1; data/libssh-0.9.5/src/external/blowfish.c:684:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ssh_blf_key(&c, (uint8_t *) key2, strlen(key2)); data/libssh-0.9.5/src/external/fe25519.c:14:17: [1] (buffer) equal: 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. static uint32_t equal(uint32_t a,uint32_t b) /* 16-bit inputs */ data/libssh-0.9.5/src/external/fe25519.c:83:18: [1] (buffer) equal: 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. uint32_t m = equal(r->v[31],127); data/libssh-0.9.5/src/external/fe25519.c:86:14: [1] (buffer) equal: 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. m &= equal(r->v[i],255); data/libssh-0.9.5/src/external/fe25519.c:131:9: [1] (buffer) equal: 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. r = equal(t.v[0],0); data/libssh-0.9.5/src/external/fe25519.c:133:14: [1] (buffer) equal: 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. r &= equal(t.v[i],0); data/libssh-0.9.5/src/external/ge25519.c:173:22: [1] (buffer) equal: 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. static unsigned char equal(signed char b,signed char c) data/libssh-0.9.5/src/external/ge25519.c:203:14: [1] (buffer) equal: 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. equal(b,1) | equal(b,-1)); data/libssh-0.9.5/src/external/ge25519.c:203:27: [1] (buffer) equal: 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. equal(b,1) | equal(b,-1)); data/libssh-0.9.5/src/external/ge25519.c:205:14: [1] (buffer) equal: 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. equal(b,2) | equal(b,-2)); data/libssh-0.9.5/src/external/ge25519.c:205:27: [1] (buffer) equal: 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. equal(b,2) | equal(b,-2)); data/libssh-0.9.5/src/external/ge25519.c:207:14: [1] (buffer) equal: 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. equal(b,3) | equal(b,-3)); data/libssh-0.9.5/src/external/ge25519.c:207:27: [1] (buffer) equal: 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. equal(b,3) | equal(b,-3)); data/libssh-0.9.5/src/external/ge25519.c:209:14: [1] (buffer) equal: 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. equal(b,-4)); data/libssh-0.9.5/src/gcrypt_missing.c:64:5: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(ret, "0"); data/libssh-0.9.5/src/getpass.c:76:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, tmp, len); data/libssh-0.9.5/src/gssapi.c:266:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). name_buf.length = strlen(name_buf.value) + 1; data/libssh-0.9.5/src/gssapi.c:652:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). namebuf.length = strlen(session->opts.gss_client_identity); data/libssh-0.9.5/src/gssapi.c:737:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). hostname.length = strlen(name_buf) + 1; data/libssh-0.9.5/src/kex.c:310:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). client_kex_len = strlen(client_str); data/libssh-0.9.5/src/kex.c:317:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). server_kex_len = strlen(server_str); data/libssh-0.9.5/src/kex.c:720:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(kex); data/libssh-0.9.5/src/kex.c:721:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (len + strlen(KEX_EXTENSION_CLIENT) + 2 < len) { data/libssh-0.9.5/src/kex.c:725:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). kex_len = len + strlen(KEX_EXTENSION_CLIENT) + 2; /* comma, NULL */ data/libssh-0.9.5/src/known_hosts.c:255:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). hmac_update(mac, host, strlen(host)); data/libssh-0.9.5/src/known_hosts.c:360:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(tokens->tokens[0])); data/libssh-0.9.5/src/known_hosts.c:364:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(tokens->tokens[0])); data/libssh-0.9.5/src/known_hosts.c:556:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (fwrite(buffer, strlen(buffer), 1, file) != 1 || ferror(file)) { data/libssh-0.9.5/src/knownhosts.c:66:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). hmac_update(mac_ctx, name, strlen(name)); data/libssh-0.9.5/src/knownhosts.c:171:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(buf); data/libssh-0.9.5/src/knownhosts.c:574:13: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(methods_buffer, data/libssh-0.9.5/src/knownhosts.c:576:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sizeof(methods_buffer) - strlen(methods_buffer) - 1); data/libssh-0.9.5/src/knownhosts.c:579:9: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(methods_buffer, data/libssh-0.9.5/src/knownhosts.c:581:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sizeof(methods_buffer) - strlen(methods_buffer) - 1); data/libssh-0.9.5/src/knownhosts.c:669:52: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cmp = match_hostname(host_port, q, strlen(q)); data/libssh-0.9.5/src/knownhosts.c:671:51: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cmp = match_hostname(hostname, q, strlen(q)); data/libssh-0.9.5/src/knownhosts.c:1025:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(entry); data/libssh-0.9.5/src/legacy.c:110:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t klen = strlen(filename) + 4 + 1; data/libssh-0.9.5/src/legacy.c:630:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(buffer); data/libssh-0.9.5/src/legacy.c:668:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(keyfile) + 5; data/libssh-0.9.5/src/messages.c:592:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(msg->auth_request.password)); data/libssh-0.9.5/src/messages.c:1057:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(session->kbdint->answers[n])); data/libssh-0.9.5/src/misc.c:112:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). szPath = malloc(strlen(tmp) + 1); data/libssh-0.9.5/src/misc.c:199: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(str) < 7) { data/libssh-0.9.5/src/misc.c:381:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(host) + 3 + 5 + 1; data/libssh-0.9.5/src/misc.c:855:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(path); data/libssh-0.9.5/src/misc.c:882:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(new, path, len); data/libssh-0.9.5/src/misc.c:911:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(path); data/libssh-0.9.5/src/misc.c:924:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(s); data/libssh-0.9.5/src/misc.c:936:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(new, s, len); data/libssh-0.9.5/src/misc.c:1067: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). ld = strlen(p); data/libssh-0.9.5/src/misc.c:1071: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). ld = strlen(d); data/libssh-0.9.5/src/misc.c:1078:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). lh = strlen(h); data/libssh-0.9.5/src/misc.c:1119: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(r) > MAX_BUF_SIZE) { data/libssh-0.9.5/src/misc.c:1190: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). i += strlen(x); data/libssh-0.9.5/src/misc.c:1198:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen(buf); data/libssh-0.9.5/src/misc.c:1199:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf + l, x, sizeof(buf) - l - 1); data/libssh-0.9.5/src/misc.c:1246: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(banner) < 6 || data/libssh-0.9.5/src/misc.c:1258:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(banner) > 6) { data/libssh-0.9.5/src/misc.c:1281:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(openssh) > 9) { data/libssh-0.9.5/src/misc.c:1554: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(file_name) > 32 * 1024) { data/libssh-0.9.5/src/misc.c:1560:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). required_buf_len = (size_t)3 * strlen(file_name) + 1; data/libssh-0.9.5/src/misc.c:1719: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). if ((2 * strlen(string) + 1) > buf_len) { data/libssh-0.9.5/src/options.c:2019: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(r) > MAX_BUF_SIZE) { data/libssh-0.9.5/src/options.c:2062: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). i += strlen(x); data/libssh-0.9.5/src/options.c:2070:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen(buf); data/libssh-0.9.5/src/options.c:2071:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf + l, x, sizeof(buf) - l - 1); data/libssh-0.9.5/src/pki.c:50:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # undef read data/libssh-0.9.5/src/pki.c:51:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # define read _read data/libssh-0.9.5/src/pki.c:1641: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). buflen = strlen(key_buf); data/libssh-0.9.5/src/pki.c:1644: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). cmp = strncmp(key_buf, OPENSSH_HEADER_BEGIN, strlen(OPENSSH_HEADER_BEGIN)); data/libssh-0.9.5/src/pki.c:1989:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). rc = fwrite(key_buf, strlen(key_buf), 1, fp); data/libssh-0.9.5/src/pki_container_openssh.c:201:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(passphrase), data/libssh-0.9.5/src/pki_container_openssh.c:252:46: [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). cmp = strncmp(ptr, OPENSSH_HEADER_BEGIN, strlen(OPENSSH_HEADER_BEGIN)); data/libssh-0.9.5/src/pki_container_openssh.c:257:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ptr += strlen(OPENSSH_HEADER_BEGIN); data/libssh-0.9.5/src/pki_container_openssh.c:284:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(OPENSSH_AUTH_MAGIC) + 1, data/libssh-0.9.5/src/pki_container_openssh.c:296:46: [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). cmp = strncmp(magic, OPENSSH_AUTH_MAGIC, strlen(OPENSSH_AUTH_MAGIC)); data/libssh-0.9.5/src/pki_container_openssh.c:503:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(passphrase), data/libssh-0.9.5/src/pki_container_openssh.c:660:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (size_t)strlen(OPENSSH_AUTH_MAGIC) + 1, OPENSSH_AUTH_MAGIC, data/libssh-0.9.5/src/pki_container_openssh.c:689:25: [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). explicit_bzero(b64, strlen((char *)b64)); data/libssh-0.9.5/src/pki_crypto.c:74:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strlen(buf); data/libssh-0.9.5/src/pki_gcrypt.c:311:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (passphrase_to_key(passphrase, strlen(passphrase), iv, key, key_len) < 0) { data/libssh-0.9.5/src/pki_gcrypt.c:441:25: [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). header_begin_size = strlen(header_begin); data/libssh-0.9.5/src/pki_gcrypt.c:442:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). header_end_size = strlen(header_end); data/libssh-0.9.5/src/pki_mbedcrypto.c:93:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t b64len = strlen(b64_key) + 1; data/libssh-0.9.5/src/scp.c:84: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(location) > 32 * 1024) { data/libssh-0.9.5/src/scp.c:166:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). scp_location_len = strlen(scp->location); data/libssh-0.9.5/src/scp.c:345:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vis_encoded_len = (2 * strlen(dir)) + 1; data/libssh-0.9.5/src/scp.c:380: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). rc = ssh_channel_write(scp->channel, buffer, strlen(buffer)); data/libssh-0.9.5/src/scp.c:424: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). rc = ssh_channel_write(scp->channel, buffer, strlen(buffer)); data/libssh-0.9.5/src/scp.c:482:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vis_encoded_len = (2 * strlen(file)) + 1; data/libssh-0.9.5/src/scp.c:517: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). rc = ssh_channel_write(scp->channel, buffer, strlen(buffer)); data/libssh-0.9.5/src/scp.c:727:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (read < len - 1) { data/libssh-0.9.5/src/scp.c:728:54: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). err = ssh_channel_read(scp->channel, &buffer[read], 1, 0); data/libssh-0.9.5/src/scp.c:746:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). buffer[read] = 0; data/libssh-0.9.5/src/scp.c:898: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). rc = ssh_channel_write(scp->channel, buffer, strlen(buffer)); data/libssh-0.9.5/src/server.c:111:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(hostkeys); data/libssh-0.9.5/src/server.c:118:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(hostkeys); data/libssh-0.9.5/src/server.c:127:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(hostkeys); data/libssh-0.9.5/src/server.c:131:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(hostkeys); data/libssh-0.9.5/src/server.c:138: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(hostkeys) == 0) { data/libssh-0.9.5/src/server.c:579:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(methods_c, "publickey,", data/libssh-0.9.5/src/server.c:580:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sizeof(methods_c) - strlen(methods_c) - 1); data/libssh-0.9.5/src/server.c:583:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(methods_c,"gssapi-with-mic,", data/libssh-0.9.5/src/server.c:584:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sizeof(methods_c) - strlen(methods_c) - 1); data/libssh-0.9.5/src/server.c:587:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(methods_c, "keyboard-interactive,", data/libssh-0.9.5/src/server.c:588:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sizeof(methods_c) - strlen(methods_c) - 1); data/libssh-0.9.5/src/server.c:591:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(methods_c, "password,", data/libssh-0.9.5/src/server.c:592:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sizeof(methods_c) - strlen(methods_c) - 1); data/libssh-0.9.5/src/server.c:595:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(methods_c, "hostbased,", data/libssh-0.9.5/src/server.c:596:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sizeof(methods_c) - strlen(methods_c) - 1); data/libssh-0.9.5/src/server.c:599:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (methods_c[0] == '\0' || methods_c[strlen(methods_c)-1] != ',') { data/libssh-0.9.5/src/server.c:604:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). methods_c[strlen(methods_c) - 1] = '\0'; // strip the comma. We are sure there is at data/libssh-0.9.5/src/socket.c:37:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #undef read data/libssh-0.9.5/src/socket.c:38:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define read _read data/libssh-0.9.5/src/socket.c:545:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(s->fd,buffer, len); data/libssh-0.9.5/src/string.c:117:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(what); data/libssh-0.9.5/src/token.c:51:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). explicit_bzero(tokens->tokens[i], strlen(tokens->tokens[i])); data/libssh-0.9.5/src/token.c:219:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). max = MAX(strlen(available_list), strlen(preferred_list)); data/libssh-0.9.5/src/token.c:219:39: [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). max = MAX(strlen(available_list), strlen(preferred_list)); data/libssh-0.9.5/src/token.c:247:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(a_tok->tokens[j]); data/libssh-0.9.5/src/token.c:289:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). max_len = strlen(list); data/libssh-0.9.5/src/token.c:307: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(tok->tokens[0]) > 0) { data/libssh-0.9.5/src/token.c:323:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tok->tokens[i]) > 0) { data/libssh-0.9.5/src/token.c:341:17: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(ret, ",", (max_len - strlen(ret) - 1)); data/libssh-0.9.5/src/token.c:341:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(ret, ",", (max_len - strlen(ret) - 1)); data/libssh-0.9.5/src/token.c:343:13: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(ret, tok->tokens[i], (max_len - strlen(ret) - 1)); data/libssh-0.9.5/src/token.c:343:53: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(ret, tok->tokens[i], (max_len - strlen(ret) - 1)); data/libssh-0.9.5/src/token.c:381: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). concat_len = strlen(list); data/libssh-0.9.5/src/token.c:385:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). concat_len += strlen(appended_list); data/libssh-0.9.5/src/token.c:401:9: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(concat, ",", concat_len - strlen(concat) - 1); data/libssh-0.9.5/src/token.c:401:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(concat, ",", concat_len - strlen(concat) - 1); data/libssh-0.9.5/src/token.c:404:9: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(concat, appended_list, concat_len - strlen(concat) - 1); data/libssh-0.9.5/src/token.c:404:53: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(concat, appended_list, concat_len - strlen(concat) - 1); data/libssh-0.9.5/tests/authentication.c:25:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(strlen(name)>0) data/libssh-0.9.5/tests/authentication.c:27:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(strlen(instruction)>0) data/libssh-0.9.5/tests/authentication.c:38:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memset(buffer,0,strlen(buffer)); data/libssh-0.9.5/tests/authentication.c:67: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). memset(password,0,strlen(password)); data/libssh-0.9.5/tests/benchmarks/bench_raw.c:85:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). err=ssh_channel_write(channel,script,strlen(script)); data/libssh-0.9.5/tests/client/torture_client_config.c:69:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(filename) > 0) { data/libssh-0.9.5/tests/client/torture_rekey.c:289:12: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask(S_IRWXO | S_IRWXG); data/libssh-0.9.5/tests/client/torture_rekey.c:291:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(mask); data/libssh-0.9.5/tests/client/torture_rekey.c:479:12: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask(S_IRWXO | S_IRWXG); data/libssh-0.9.5/tests/client/torture_rekey.c:481:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(mask); data/libssh-0.9.5/tests/client/torture_sftp_fsync.c:81:12: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask(S_IRWXO | S_IRWXG); data/libssh-0.9.5/tests/client/torture_sftp_fsync.c:83:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(mask); data/libssh-0.9.5/tests/client/torture_sftp_fsync.c:95:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). count = strlen(buf) + 1; data/libssh-0.9.5/tests/client/torture_sftp_read.c:79:12: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask(S_IRWXO | S_IRWXG); data/libssh-0.9.5/tests/client/torture_sftp_read.c:81:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(mask); data/libssh-0.9.5/tests/fuzz/ssh_server_fuzzer.cpp:71:54: [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). ssize_t write_res = write(fd, kRSAPrivateKeyPEM, strlen(kRSAPrivateKeyPEM)); data/libssh-0.9.5/tests/fuzz/ssh_server_fuzzer.cpp:72:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert(write_res == strlen(kRSAPrivateKeyPEM)); data/libssh-0.9.5/tests/pkd/pkd_daemon.c:306:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). kex_len = strlen(default_kex) + strlen(GEX_SHA1) + 2; data/libssh-0.9.5/tests/pkd/pkd_daemon.c:306:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). kex_len = strlen(default_kex) + strlen(GEX_SHA1) + 2; data/libssh-0.9.5/tests/pkd/pkd_hello.c:85:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). pkd_dargs.payload.len = strlen(arg); data/libssh-0.9.5/tests/pkd/pkd_util.c:72: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(version) < 11) { data/libssh-0.9.5/tests/server/test_server/default_cb.c:705:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, buf, BUF_SIZE); data/libssh-0.9.5/tests/server/test_server/default_cb.c:721:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, buf, BUF_SIZE); data/libssh-0.9.5/tests/server/torture_server.c:216:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(200 * 1000); data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:115:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, buf, BUF_SIZE); data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:131:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, buf, BUF_SIZE); data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:195:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). expected_len = strlen(sdata->username); data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:211:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). expected_len = strlen(sdata->password); data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:238:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). expected_len = strlen(sdata->password); data/libssh-0.9.5/tests/server/torture_server_auth_kbdint.c:601:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(200 * 1000); data/libssh-0.9.5/tests/server/torture_server_config.c:269:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(200 * 1000); data/libssh-0.9.5/tests/test_pcap.c:44:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buffer_add_data(buffer,str,strlen(str)); data/libssh-0.9.5/tests/test_pcap.c:47: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). ssh_pcap_context_write(ctx,SSH_PCAP_DIR_OUT,str,strlen(str),strlen(str)); data/libssh-0.9.5/tests/test_pcap.c:47:62: [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). ssh_pcap_context_write(ctx,SSH_PCAP_DIR_OUT,str,strlen(str),strlen(str)); data/libssh-0.9.5/tests/test_tunnel.c:37:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ssh_channel_write(channel,string,strlen(string)); data/libssh-0.9.5/tests/test_tunnel.c:42:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). } while(error < strlen(string) && error >= 0); data/libssh-0.9.5/tests/test_tunnel.c:44:54: [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). error=ssh_channel_read_nonblocking(channel,buffer,strlen(string),0); data/libssh-0.9.5/tests/test_tunnel.c:46:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(memcmp(buffer,string,strlen(string))!=0){ data/libssh-0.9.5/tests/torture.c:44:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define read _read data/libssh-0.9.5/tests/torture.c:152:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(path) + strlen(dp->d_name) + 2; data/libssh-0.9.5/tests/torture.c:152:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(path) + strlen(dp->d_name) + 2; data/libssh-0.9.5/tests/torture.c:212:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(fd, buf, sizeof(buf)); data/libssh-0.9.5/tests/torture.c:249: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(10 * 1000); data/libssh-0.9.5/tests/torture.c:491:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (env != NULL && env[0] != '\0' && strlen(env) < 6) { data/libssh-0.9.5/tests/torture.c:558:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(p) + 1 + strlen(TORTURE_PCAP_FILE) + 1; data/libssh-0.9.5/tests/torture.c:558: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). len = strlen(p) + 1 + strlen(TORTURE_PCAP_FILE) + 1; data/libssh-0.9.5/tests/torture.c:566:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(p) + 1 + strlen(TORTURE_SSHD_PIDFILE) + 1; data/libssh-0.9.5/tests/torture.c:566: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). len = strlen(p) + 1 + strlen(TORTURE_SSHD_PIDFILE) + 1; data/libssh-0.9.5/tests/torture.c:574:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(p) + 1 + strlen(TORTURE_SSHD_CONFIG) + 1; data/libssh-0.9.5/tests/torture.c:574: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). len = strlen(p) + 1 + strlen(TORTURE_SSHD_CONFIG) + 1; data/libssh-0.9.5/tests/torture.c:831: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(200 * 1000); data/libssh-0.9.5/tests/torture.c:912:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(10 * 1000); data/libssh-0.9.5/tests/torture.c:1002:12: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask(S_IRWXO | S_IRWXG); data/libssh-0.9.5/tests/torture.c:1004:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(mask); data/libssh-0.9.5/tests/torture.c:1157: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(file_path, "\\"); data/libssh-0.9.5/tests/torture.c:1335:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). rc = write(fd, data, strlen(data)); data/libssh-0.9.5/tests/torture.c:1336:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert_int_equal(rc, strlen(data)); data/libssh-0.9.5/tests/torture_pki.c:14:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define read _read data/libssh-0.9.5/tests/torture_pki.c:51:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size = read(fd, key, sb.st_size); data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c:50:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(LOCALHOST_PATTERN_ED25519), data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c:52:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (nwritten != strlen(LOCALHOST_PATTERN_ED25519)) { data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c:65:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(LOCALHOST_RSA_LINE), data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c:67:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (nwritten != strlen(LOCALHOST_RSA_LINE)) { data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c:96:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(LOCALHOST_PATTERN_ED25519), data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c:98:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (nwritten != strlen(LOCALHOST_PATTERN_ED25519)) { data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c:112:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(LOCALHOST_RSA_LINE), data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c:114:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (nwritten != strlen(LOCALHOST_RSA_LINE)) { data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c:128:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(LOCALHOST_PATTERN_ED25519), data/libssh-0.9.5/tests/unittests/torture_knownhosts_parsing.c:130:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (nwritten != strlen(LOCALHOST_PATTERN_ED25519)) { data/libssh-0.9.5/tests/unittests/torture_misc.c:212:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(50000); data/libssh-0.9.5/tests/unittests/torture_misc.c:224:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(50000); data/libssh-0.9.5/tests/unittests/torture_pki_dsa.c:185:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(comment_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_dsa.c:185:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(comment_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_dsa.c:216:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(whitespace_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_dsa.c:216:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(whitespace_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_dsa.c:661: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). keylen = strlen(key_buf); data/libssh-0.9.5/tests/unittests/torture_pki_ecdsa.c:257:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(comment_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_ecdsa.c:257:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(comment_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_ecdsa.c:288:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(whitespace_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_ecdsa.c:288:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(whitespace_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_ed25519.c:166:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(comment_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_ed25519.c:166:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(comment_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_ed25519.c:205:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(whitespace_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_ed25519.c:205:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(whitespace_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_rsa.c:230:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(comment_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_rsa.c:230:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(comment_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_rsa.c:268:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(whitespace_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_pki_rsa.c:268:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file_str_len = strlen(whitespace_str) + strlen(key_str) + 1; data/libssh-0.9.5/tests/unittests/torture_server_x11.c:37:12: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask(S_IRWXO | S_IRWXG); data/libssh-0.9.5/tests/unittests/torture_server_x11.c:39:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(mask); data/libssh-0.9.5/tests/unittests/torture_server_x11.c:78:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(200); ANALYSIS SUMMARY: Hits = 885 Lines analyzed = 107353 in approximately 2.41 seconds (44564 lines/second) Physical Source Lines of Code (SLOC) = 77260 Hits@level = [0] 714 [1] 274 [2] 512 [3] 30 [4] 68 [5] 1 Hits@level+ = [0+] 1599 [1+] 885 [2+] 611 [3+] 99 [4+] 69 [5+] 1 Hits/KSLOC@level+ = [0+] 20.6963 [1+] 11.4548 [2+] 7.90836 [3+] 1.28139 [4+] 0.893088 [5+] 0.0129433 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.