commit | fdec957e553a9437468cbd254c71a86fa4806322 | [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> | Mon Nov 17 11:01:08 2014 +0100 |
tree | 32e6275e41a236d965c15ac38135d3da2df6cd84 | |
parent | d3ae43024135ef8acb2f44a106c2acbb50163844 [diff] [blame] |
Fix memory leak with crafted X.509 certs
diff --git a/library/x509parse.c b/library/x509parse.c index 806dcea..c00c5db 100644 --- a/library/x509parse.c +++ b/library/x509parse.c
@@ -866,6 +866,9 @@ /* Allocate and assign next pointer */ if (*p < end) { + if( cur->next != NULL ) + return( POLARSSL_ERR_X509_CERT_INVALID_EXTENSIONS ); + cur->next = (asn1_sequence *) malloc( sizeof( asn1_sequence ) );