zero data in hm_fragment on alloc
authorNeil Horman <nhorman@openssl.org>
Thu, 9 Nov 2023 13:13:58 +0000 (08:13 -0500)
committerMatt Caswell <matt@openssl.org>
Fri, 24 Nov 2023 10:48:59 +0000 (10:48 +0000)
commit02a2c3bc1336d2af1601fbc5d959c6babc1bce12
tree9718a0b5b8954224fe2d391a2de0c3be1f56b78c
parent4b5215998142c70a0e8f1a72d6fc06b6e3d69a5c
zero data in hm_fragment on alloc

if we allocate a new hm_frament in dtls1_buffer_message with
dtls1_hm_fragment_new, the returned fragment contains uninitalized data in the
msg_header field.  If an error then occurs, and we free the fragment,
dtls_hm_fragment_free interrogates the msg_header field (which is garbage), and
potentially references undefined values, or worse, accidentally references
available memory that is not owned, leading to various corruptions.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2261)
ssl/statem/statem_dtls.c