summaryrefslogtreecommitdiff
path: root/asn.h
diff options
context:
space:
mode:
authorGergely Nagy <ngg@tresorit.com>2016-12-14 13:19:01 +0100
committerGergely Nagy <ngg@tresorit.com>2016-12-14 13:19:01 +0100
commit3d9181d7bdd8e491f745dbc9e34bd20b6f6da069 (patch)
treebfbf787ff14d5396980742b5ea7105b7933333d7 /asn.h
parent20c58248075d9cbbe72b95372ac9d41a2c52cd8a (diff)
downloadcryptopp-git-3d9181d7bdd8e491f745dbc9e34bd20b6f6da069.tar.gz
Fix possible DoS in ASN.1 decoders (CVE-2016-9939)
Diffstat (limited to 'asn.h')
-rw-r--r--asn.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/asn.h b/asn.h
index ed9de52c..33f0dd09 100644
--- a/asn.h
+++ b/asn.h
@@ -498,6 +498,8 @@ void BERDecodeUnsigned(BufferedTransformation &in, T &w, byte asnTag = INTEGER,
bool definite = BERLengthDecode(in, bc);
if (!definite)
BERDecodeError();
+ if (bc > in.MaxRetrievable())
+ BERDecodeError();
SecByteBlock buf(bc);