commit | b134060f90ee0e47a63a36f0c36334edeed4a110 | [log] [tgz] |
---|---|---|
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | Tue Nov 11 23:11:16 2014 +0100 |
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | Wed Nov 12 00:01:52 2014 +0100 |
tree | 8b9a7fbf6b55f45b695a776e967089d3b088f67f | |
parent | 0369a5291b525d2739e4ccb388761baaee86793f [diff] [blame] |
Fix memory leak with crafted X.509 certs
diff --git a/library/x509_crt.c b/library/x509_crt.c index 88d7f04..525d250 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c
@@ -359,6 +359,9 @@ /* Allocate and assign next pointer */ if( cur->buf.p != NULL ) { + if( cur->next != NULL ) + return( POLARSSL_ERR_X509_INVALID_EXTENSIONS ); + cur->next = (asn1_sequence *) polarssl_malloc( sizeof( asn1_sequence ) );