mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 19:18:08 +00:00
Fix overflow check in oid_get_numeric_string()
(The fix in 791eed3
was wrong.)
This commit is contained in:
parent
4f47538ad8
commit
14d8564402
1 changed files with 1 additions and 2 deletions
|
@ -591,8 +591,7 @@ int oid_get_numeric_string( char *buf, size_t size,
|
|||
for( i = 1; i < oid->len; i++ )
|
||||
{
|
||||
/* Prevent overflow in value. */
|
||||
unsigned int v = value << 7;
|
||||
if ( v < value )
|
||||
if ( ( ( value << 7 ) >> 7 ) != value )
|
||||
return( POLARSSL_ERR_DEBUG_BUF_TOO_SMALL );
|
||||
|
||||
value <<= 7;
|
||||
|
|
Loading…
Reference in a new issue