mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-25 02:28:11 +00:00
- Fixed logic error on end of 'full' chain
This commit is contained in:
parent
6335fafd74
commit
e9581d66b0
1 changed files with 2 additions and 2 deletions
|
@ -663,13 +663,13 @@ int x509parse_crt( x509_cert *chain, unsigned char *buf, int buflen )
|
||||||
if( crt == NULL || buf == NULL )
|
if( crt == NULL || buf == NULL )
|
||||||
return( 1 );
|
return( 1 );
|
||||||
|
|
||||||
while( crt->version != 0 || crt->next != NULL )
|
while( crt->version != 0 && crt->next != NULL )
|
||||||
crt = crt->next;
|
crt = crt->next;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add new certificate on the end of the chain if needed.
|
* Add new certificate on the end of the chain if needed.
|
||||||
*/
|
*/
|
||||||
if ( crt->next == NULL)
|
if ( crt->version != 0 && crt->next == NULL)
|
||||||
{
|
{
|
||||||
crt->next = (x509_cert *) malloc( sizeof( x509_cert ) );
|
crt->next = (x509_cert *) malloc( sizeof( x509_cert ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue