From 0980f652669124cce6b5840380ebe9a4ffaea39f Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 18 Jun 2010 00:57:26 +0000 Subject: [PATCH] check for integer overflow in OID::DecodeValue() --- asn.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/asn.cpp b/asn.cpp index 3ebbaf76..8ae1ad65 100644 --- a/asn.cpp +++ b/asn.cpp @@ -232,6 +232,8 @@ size_t OID::DecodeValue(BufferedTransformation &bt, word32 &v) if (!bt.Get(b)) BERDecodeError(); i++; + if (v >> (8*sizeof(v)-7)) // v about to overflow + BERDecodeError(); v <<= 7; v += b & 0x7f; if (!(b & 0x80))