diff --git a/library/x509parse.c b/library/x509parse.c index ec4fffc939..25df0f7af1 100644 --- a/library/x509parse.c +++ b/library/x509parse.c @@ -305,6 +305,8 @@ static int x509_get_name( unsigned char **p, if( cur->next == NULL ) return( POLARSSL_ERR_X509_MALLOC_FAILED ); + memset( cur->next, 0, sizeof( x509_name ) ); + return( x509_get_name( p, end2, cur->next ) ); }