From 791eed3f339f50df99e52aaf4ded9891b76995cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 9 Jul 2013 16:26:08 +0200 Subject: [PATCH] Fix portability issue in oid_get_numeric_string() --- library/oid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;