diff options
author | weidai <weidai11@users.noreply.github.com> | 2010-06-18 00:57:26 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2010-06-18 00:57:26 +0000 |
commit | 0980f652669124cce6b5840380ebe9a4ffaea39f (patch) | |
tree | cfcc298b5b875f50a3fc15f712f0c806906b1474 /asn.cpp | |
parent | 5a9739c92223101c2b7073e051397e8fa51ef071 (diff) | |
download | cryptopp-git-0980f652669124cce6b5840380ebe9a4ffaea39f.tar.gz |
check for integer overflow in OID::DecodeValue()
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)) |