diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2010-06-18 00:57:26 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2010-06-18 00:57:26 +0000 |
commit | 5f56484a3d47bb203d82bb1bd54136fef1a07056 (patch) | |
tree | cfcc298b5b875f50a3fc15f712f0c806906b1474 /asn.cpp | |
parent | 5ed048bd178f6a9789c90e65f406e308b3bb35cc (diff) | |
download | cryptopp-5f56484a3d47bb203d82bb1bd54136fef1a07056.tar.gz |
check for integer overflow in OID::DecodeValue()
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@483 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'asn.cpp')
-rw-r--r-- | asn.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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)) |