mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-22 13:51:09 +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
|
@ -591,8 +591,7 @@ int oid_get_numeric_string( char *buf, size_t size,
|
||||||
for( i = 1; i < oid->len; i++ )
|
for( i = 1; i < oid->len; i++ )
|
||||||
{
|
{
|
||||||
/* Prevent overflow in value. */
|
/* Prevent overflow in value. */
|
||||||
unsigned int v = value << 7;
|
if ( ( ( value << 7 ) >> 7 ) != value )
|
||||||
if ( v < value )
|
|
||||||
return( POLARSSL_ERR_DEBUG_BUF_TOO_SMALL );
|
return( POLARSSL_ERR_DEBUG_BUF_TOO_SMALL );
|
||||||
|
|
||||||
value <<= 7;
|
value <<= 7;
|
||||||
|
|
Loading…
Reference in a new issue