diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2004-07-01 18:15:33 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2004-07-01 18:15:33 +0000 |
commit | 0efea28dcb055c20380726f2dcd533e9a58c5c6b (patch) | |
tree | ec5970e65bc871fa35a6c374c41e355f47954d94 /apps | |
parent | 4bab9b763d5fb41a0aba7d7d8fb27a64ca5d3daf (diff) | |
download | openssl-0efea28dcb055c20380726f2dcd533e9a58c5c6b.tar.gz |
Don't try to parse non string types.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/asn1pars.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/asn1pars.c b/apps/asn1pars.c index 305db15903..f1d8bc8b98 100644 --- a/apps/asn1pars.c +++ b/apps/asn1pars.c @@ -309,6 +309,7 @@ bad: for (i=0; i<sk_num(osk); i++) { ASN1_TYPE *atmp; + int typ; j=atoi(sk_value(osk,i)); if (j == 0) { @@ -327,6 +328,15 @@ bad: ERR_print_errors(bio_err); goto end; } + typ = ASN1_TYPE_get(at); + if ((typ == V_ASN1_OBJECT) + || (typ == V_ASN1_NULL)) + { + BIO_printf(bio_err, "Can't parse %s type\n", + typ == V_ASN1_NULL ? "NULL" : "OBJECT"); + ERR_print_errors(bio_err); + goto end; + } /* hmm... this is a little evil but it works */ tmpbuf=at->value.asn1_string->data; tmplen=at->value.asn1_string->length; |