aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/asn1/asn1_oid.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/asn1/asn1_oid.cpp b/src/asn1/asn1_oid.cpp
index 009b1c2fc..bbbfd822b 100644
--- a/src/asn1/asn1_oid.cpp
+++ b/src/asn1/asn1_oid.cpp
@@ -173,7 +173,12 @@ void OID::decode_from(BER_Decoder& decoder)
while(i != obj.value.size() - 1)
{
++i;
+
+ if(component >> (32-7))
+ throw Decoding_Error("OID component overflow");
+
component = (component << 7) + (obj.value[i] & 0x7F);
+
if(!(obj.value[i] & 0x80))
break;
}