mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-25 00:48:28 +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 )
|
||||
return( 1 );
|
||||
|
||||
while( crt->version != 0 || crt->next != NULL )
|
||||
while( crt->version != 0 && crt->next != NULL )
|
||||
crt = crt->next;
|
||||
|
||||
/*
|
||||
* 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 ) );
|
||||
|
||||
|
|
Loading…
Reference in a new issue