projects
/
esp-idf
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bdc499a
)
mbedtls: Fix memory leak in initial ECDH exchange if OOM/failure occurs
author
Angus Gratton
<angus@espressif.com>
Wed, 12 Jul 2017 08:34:26 +0000
(16:34 +0800)
committer
Angus Gratton
<gus@projectgus.com>
Thu, 13 Jul 2017 07:55:57 +0000
(15:55 +0800)
In ecp_mul_comb(), if (!p_eq_g && grp->T == NULL) and ecp_precompute_comb() fails (which can happen due to OOM), then the new array of points T was leaked.
components/mbedtls/library/ecp.c
patch
|
blob
|
history
diff --git
a/components/mbedtls/library/ecp.c
b/components/mbedtls/library/ecp.c
index f51f2251edf8ce3a30802aff93f05c7629ad9e9d..fa5d0ddc1595265069d924b35a3743cd168d5de5 100644
(file)
--- a/
components/mbedtls/library/ecp.c
+++ b/
components/mbedtls/library/ecp.c
@@
-1406,7
+1406,7
@@
static int ecp_mul_comb( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
cleanup:
- if( T != NULL &&
! p_eq_g
)
+ if( T != NULL &&
T != grp->T
)
{
for( i = 0; i < pre_len; i++ )
mbedtls_ecp_point_free( &T[i] );