You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mbedtls_md_setup() allocates a hash-specific context and then, if
requested, an extra HMAC context. If the second allocation failed, the
hash context was not freed.
Fix this by ensuring that the mbedtls_md_context_t object is always in
a consistent state, in particular, that the md_info field is always
set. For robustness, ensure that the object is in a consistent state
even on errors (other than BAD_INPUT_DATA if the object was not in a
consistent state on entry).
FixMbed-TLS#3486
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
mbedtls_md_setup() allocates a hash-specific context and then, if
requested, an extra HMAC context. If the second allocation failed, the
hash context was not freed.
Fix this by ensuring that the mbedtls_md_context_t object is always in
a consistent state, in particular, that the md_info field is always
set. For robustness, ensure that the object is in a consistent state
even on errors (other than BAD_INPUT_DATA if the object was not in a
consistent state on entry).
FixMbed-TLS#3486
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Carl Aage Amundsen <Carl.Amundsen@silabs.com>
Description
Bug
The following code produces a memory leak. This happens because I've modified the allocator to return
NULL
on the second allocation request.Fix it by moving
https://github.com/ARMmbed/mbedtls/blob/3ee91f47f44d4133d3f155b113abfdf7bef98c4e/library/md.c#L471
to before line 461
The text was updated successfully, but these errors were encountered: