mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
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: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22679)
This commit is contained in:
parent
5091aadc22
commit
e59ed0bfee
@ -62,7 +62,7 @@ static hm_fragment *dtls1_hm_fragment_new(size_t frag_len, int reassembly)
|
||||
unsigned char *buf = NULL;
|
||||
unsigned char *bitmask = NULL;
|
||||
|
||||
if ((frag = OPENSSL_malloc(sizeof(*frag))) == NULL)
|
||||
if ((frag = OPENSSL_zalloc(sizeof(*frag))) == NULL)
|
||||
return NULL;
|
||||
|
||||
if (frag_len) {
|
||||
|
Loading…
Reference in New Issue
Block a user