Print out zero length string properly.
[oweals/openssl.git] / crypto / asn1 / ameth_lib.c
index 14b5aa335bd1589da23167f30b9034d5a1e1ead8..4dd0dfa62b5b99eb7c9936ca9a1c37ab38d3c129 100644 (file)
@@ -160,6 +160,8 @@ const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(const char *str, int len)
        {
        int i;
        const EVP_PKEY_ASN1_METHOD *ameth;
+       if (len == -1)
+               len = strlen(str);
        for (i = 0; i < EVP_PKEY_asn1_get_count(); i++)
                {
                ameth = EVP_PKEY_asn1_get0(i);