Fix implementation-defined integer conversion

"When an integer is demoted to a signed integer with smaller size, or an
unsigned integer is converted to its corresponding signed integer, if
the value cannot be represented the result is implementation-defined."
This commit is contained in:
Janos Follath 2017-07-21 14:16:52 +01:00 committed by Simon Butcher
parent 1fbc5fb027
commit 5308f47038
2 changed files with 2 additions and 2 deletions

View file

@ -256,7 +256,7 @@ int x509_crt_verify_info( char *buf, size_t size, const char *prefix,
* POLARSSL_ERR_X509_CERT_VERIFY_FAILED if the chain was verified * POLARSSL_ERR_X509_CERT_VERIFY_FAILED if the chain was verified
* but found to be invalid, in which case *flags will have one * but found to be invalid, in which case *flags will have one
* or more BADCERT_XXX or POLARSSL_X509_BADCRL_XXX * or more BADCERT_XXX or POLARSSL_X509_BADCRL_XXX
* flags set, or another error (and flags set to 0xffffffff) * flags set, or another error (and flags set to -1)
* in case of a fatal error encountered during the * in case of a fatal error encountered during the
* verification process. * verification process.
*/ */

View file

@ -2182,7 +2182,7 @@ exit:
if( ret != 0 ) if( ret != 0 )
{ {
*flags = (uint32_t) -1; *flags = -1;
return( ret ); return( ret );
} }