Fix undefined behaviour in the event of a zero length session id
authorMatt Caswell <matt@openssl.org>
Wed, 1 May 2024 10:23:57 +0000 (11:23 +0100)
committerTomas Mraz <tomas@openssl.org>
Mon, 6 May 2024 08:44:22 +0000 (10:44 +0200)
commit97c6489b39c966c6e5169b9b92ec5fa9a35c7ba3
tree662c859709807b6c3db71dff949eb468e56e9a6e
parentaecaaccaf93c4b36dd830accf08f2175059c5782
Fix undefined behaviour in the event of a zero length session id

Don't attempt to memcpy a NULL pointer if the length is 0.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24309)
ssl/ssl_sess.c