Change PKCS#12 key derivation routines to cope with
[openssl.git] / crypto / pkcs12 / p12_attr.c
index 64bf4173fca2b580b45d9100b16383f342985ce8..2d4d04292a630433c396a1d802df3d9c98945b30 100644 (file)
@@ -151,7 +151,7 @@ int PKCS12_add_friendlyname_asc (PKCS12_SAFEBAG *bag, const char *name,
 {
        unsigned char *uniname;
        int ret, unilen;
-       if (!asc2uni(name, &uniname, &unilen)) {
+       if (!asc2uni(name, namelen, &uniname, &unilen)) {
                PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC,
                                                        ERR_R_MALLOC_FAILURE);
                return 0;