aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-04 04:45:54 +0000
committerlloyd <[email protected]>2010-03-04 04:45:54 +0000
commit8005808c75219340c7170b15a26b8a806f159f7c (patch)
tree239c5f75de4e4702882e46bd465b3a81dcbfb652
parent3af416b82944c2f9241965d6bc47a682938d1bc9 (diff)
Catch parse errors in OID, throw Invalid_OID
-rw-r--r--src/asn1/asn1_oid.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/asn1/asn1_oid.cpp b/src/asn1/asn1_oid.cpp
index 7db171fc8..6c420ff0d 100644
--- a/src/asn1/asn1_oid.cpp
+++ b/src/asn1/asn1_oid.cpp
@@ -20,7 +20,15 @@ OID::OID(const std::string& oid_str)
{
if(oid_str != "")
{
- id = parse_asn1_oid(oid_str);
+ try
+ {
+ id = parse_asn1_oid(oid_str);
+ }
+ catch(...)
+ {
+ throw Invalid_OID(oid_str);
+ }
+
if(id.size() < 2 || id[0] > 2)
throw Invalid_OID(oid_str);
if((id[0] == 0 || id[0] == 1) && id[1] > 39)