More size_tification.
[openssl.git] / crypto / asn1 / a_print.c
index 4a20dca85cc2f6cf367a491339d2689be31598f6..b3700b43fbbd9364626f14ae977ac45642b78397 100644 (file)
@@ -65,11 +65,12 @@ int ASN1_PRINTABLE_type(const unsigned char *s, size_t len)
        int c;
        int ia5=0;
        int t61=0;
+       int ignore_len = 0;
 
-       if (len <= 0) len= -1;
+       if (len == 0) ignore_len = 1;
        if (s == NULL) return(V_ASN1_PRINTABLESTRING);
 
-       while ((*s) && (len-- != 0))
+       while (*s && !ignore_len && len-- != 0)
                {
                c= *(s++);
 #ifndef CHARSET_EBCDIC