@@ -1730,11 +1730,14 @@ static int test_kdf_snmpkdf_bad_pw_len(void)
     EVP_KDF_CTX *kctx = NULL;
     OSSL_PARAM *params = NULL;
     unsigned char out[SHA_DIGEST_LENGTH];
+    unsigned char *password1 = NULL;
 
     static unsigned char EID1[] = {
           0x00, 0x00, 0x02, 0xb8, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x00 };
-    static unsigned char password1[] = {'L', 'P', 'U', 'Q', 'D', 'L', 's', 'K' };
 
+    password1 = OPENSSL_zalloc(1048577);
+    if (!TEST_ptr(password1))
+        return 0;
     params = construct_snmpkdf_params("sha1", EID1, sizeof(EID1),
                                       (unsigned char *)password1, 1048577);
 
@@ -1744,6 +1747,7 @@ static int test_kdf_snmpkdf_bad_pw_len(void)
         && TEST_int_eq(EVP_KDF_derive(kctx, out, 0, NULL), 0);
 
     EVP_KDF_CTX_free(kctx);
+    OPENSSL_free(password1);
     OPENSSL_free(params);
     return ret;
 }