diff --git a/library/oid.c b/library/oid.c index dd4cbf037..449b3e1f0 100644 --- a/library/oid.c +++ b/library/oid.c @@ -33,7 +33,6 @@ #include "polarssl/rsa.h" #include -#include /* * Macro to generate an internal function for oid_XXX_from_asn1() (used by @@ -572,7 +571,8 @@ int oid_get_numeric_string( char *buf, size_t size, for( i = 1; i < oid->len; i++ ) { /* Prevent overflow in value. */ - if (value > (UINT_MAX >> 7) ) + unsigned int v = value << 7; + if ( v < value ) return( POLARSSL_ERR_DEBUG_BUF_TOO_SMALL ); value <<= 7;