diff options
author | lloyd <[email protected]> | 2010-03-04 04:45:54 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-04 04:45:54 +0000 |
commit | 8005808c75219340c7170b15a26b8a806f159f7c (patch) | |
tree | 239c5f75de4e4702882e46bd465b3a81dcbfb652 /src/asn1 | |
parent | 3af416b82944c2f9241965d6bc47a682938d1bc9 (diff) |
Catch parse errors in OID, throw Invalid_OID
Diffstat (limited to 'src/asn1')
-rw-r--r-- | src/asn1/asn1_oid.cpp | 10 |
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) |