diff -ru openssl-0.9.8h/crypto/x509/x509_att.c openssl-0.9.8h+iPhone/crypto/x509/x509_att.c --- openssl-0.9.8h/crypto/x509/x509_att.c 2008-04-02 11:11:51.000000000 +0000 +++ openssl-0.9.8h+iPhone/crypto/x509/x509_att.c 2008-09-13 07:11:14.000000000 +0000 @@ -303,7 +303,7 @@ } if(!(attr->value.set = sk_ASN1_TYPE_new_null())) goto err; if(!(ttmp = ASN1_TYPE_new())) goto err; - if (len == -1) + if ((len == -1) && !(attrtype & MBSTRING_FLAG)) { if (!ASN1_TYPE_set1(ttmp, attrtype, data)) goto err;