From 14d85644020ff2858e60b179f7952f5d37b98bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 15 Jul 2013 11:01:14 +0200 Subject: [PATCH] Fix overflow check in oid_get_numeric_string() (The fix in 791eed3 was wrong.) --- library/oid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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;