openssl/ssl
Sumitra Sharma 2743594d73 Enhance code safety and readability in SSL_get_shared_ciphers()
This commit introduces two key improvements:

1. Improve code safety by replacing the conditional statement with
`if (n >= size)` and using OPENSSL_strnlen() instead of strlen().
This change ensures proper buffer size handling and adheres to
secure coding practices.

2. Enhance code readability by substituting `strcpy(p, c->name)` with
`memcpy(p, c->name, n)`. This adjustment prioritizes code clarity and
maintenance, even while mitigating a minimal buffer overflow risk.

These enhancements bolster the code's robustness and comprehensibility,
aligning with secure coding principles and best practices.

Fixes #19837

Signed-off-by: Sumitra Sharma <sumitraartsy@gmail.com>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21934)
2023-09-18 14:10:17 +02:00
..
quic Fix new typos found by codespell 2023-09-18 09:04:22 +10:00
record Copyright year updates 2023-09-07 09:59:15 +01:00
statem Fix typos found by codespell 2023-09-13 08:13:08 +02:00
bio_ssl.c Copyright year updates 2023-09-07 09:59:15 +01:00
build.info
d1_lib.c "foo * bar" should be "foo *bar" 2023-09-11 10:15:30 +02:00
d1_msg.c Copyright year updates 2023-09-07 09:59:15 +01:00
d1_srtp.c Copyright year updates 2023-09-07 09:59:15 +01:00
event_queue.c Copyright year updates 2023-09-07 09:59:15 +01:00
methods.c
pqueue.c
priority_queue.c Copyright year updates 2023-09-07 09:59:15 +01:00
s3_enc.c Copyright year updates 2023-09-07 09:59:15 +01:00
s3_lib.c Fix the SSL_CIPHER_find() function when used with a QCSO 2023-09-12 15:29:00 +02:00
s3_msg.c
ssl_asn1.c
ssl_cert_comp.c Copyright year updates 2023-09-07 09:59:15 +01:00
ssl_cert_table.h Copyright year updates 2023-09-07 09:59:15 +01:00
ssl_cert.c
ssl_ciph.c "foo * bar" should be "foo *bar" 2023-09-11 10:15:30 +02:00
ssl_conf.c "foo * bar" should be "foo *bar" 2023-09-11 10:15:30 +02:00
ssl_err_legacy.c
ssl_err.c QUIC APL: Implement backpressure on stream creation 2023-08-25 15:10:43 +02:00
ssl_init.c "foo * bar" should be "foo *bar" 2023-09-11 10:15:30 +02:00
ssl_lib.c Enhance code safety and readability in SSL_get_shared_ciphers() 2023-09-18 14:10:17 +02:00
ssl_local.h Fix the SSL_CIPHER_find() function when used with a QCSO 2023-09-12 15:29:00 +02:00
ssl_mcnf.c
ssl_rsa_legacy.c
ssl_rsa.c Copyright year updates 2023-09-07 09:59:15 +01:00
ssl_sess.c
ssl_stat.c
ssl_txt.c
ssl_utst.c
sslerr.h
t1_enc.c Copyright year updates 2023-09-07 09:59:15 +01:00
t1_lib.c
t1_trce.c
tls13_enc.c Copyright year updates 2023-09-07 09:59:15 +01:00
tls_depr.c
tls_srp.c