diff --git a/lib/asn1/der_format.c b/lib/asn1/der_format.c index 4ef50b15c..d4f40a256 100644 --- a/lib/asn1/der_format.c +++ b/lib/asn1/der_format.c @@ -110,6 +110,9 @@ der_print_heim_oid (const heim_oid *oid, char delim, char **str) struct rk_strpool *p = NULL; int i; + if (oid->length == 0) + return EINVAL; + for (i = 0; i < oid->length ; i++) { p = rk_strpoolprintf(p, "%d", oid->components[i]); if (p && i < oid->length - 1)