提交 0efea28d 编写于 作者: D Dr. Stephen Henson

Don't try to parse non string types.

上级 4bab9b76
...@@ -309,6 +309,7 @@ bad: ...@@ -309,6 +309,7 @@ bad:
for (i=0; i<sk_num(osk); i++) for (i=0; i<sk_num(osk); i++)
{ {
ASN1_TYPE *atmp; ASN1_TYPE *atmp;
int typ;
j=atoi(sk_value(osk,i)); j=atoi(sk_value(osk,i));
if (j == 0) if (j == 0)
{ {
...@@ -327,6 +328,15 @@ bad: ...@@ -327,6 +328,15 @@ bad:
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
goto end; 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 */ /* hmm... this is a little evil but it works */
tmpbuf=at->value.asn1_string->data; tmpbuf=at->value.asn1_string->data;
tmplen=at->value.asn1_string->length; tmplen=at->value.asn1_string->length;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册