diff --git a/library/oid.c b/library/oid.c index 366720ec0..750ece8e3 100644 --- a/library/oid.c +++ b/library/oid.c @@ -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;