Don't try to parse none string types.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 1 Jul 2004 18:50:12 +0000 (18:50 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 1 Jul 2004 18:50:12 +0000 (18:50 +0000)
apps/asn1pars.c

index 7db40adf0436b3edc33edeb201b4382ed3d46023..c89b358b238bd5012cd5bf3f3047e5e0f44b2437 100644 (file)
@@ -278,6 +278,7 @@ bad:
                tmplen=num;
                for (i=0; i<sk_num(osk); i++)
                        {
+                       int typ;
                        ASN1_TYPE *atmp;
                        j=atoi(sk_value(osk,i));
                        if (j == 0)
@@ -296,6 +297,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;