Fix memory leak with crafted X.509 certs

This commit is contained in:
Manuel Pégourié-Gonnard 2014-11-11 23:11:16 +01:00
parent 0369a5291b
commit b134060f90
3 changed files with 10 additions and 0 deletions

View file

@ -359,6 +359,9 @@ static int x509_get_subject_alt_name( unsigned char **p,
/* 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 ) );