8238502: sunmscapi.dll causing EXCEPTION_ACCESS_VIOLATION

Reviewed-by: wetmore, coffeys, mullan
This commit is contained in:
Weijun Wang 2020-02-04 13:15:15 -08:00
parent a88734eadc
commit b75d37538d

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -660,14 +660,14 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_loadKeysOrCertificateC
env->CallVoidMethod(obj, mGenKeyAndCertChain, env->CallVoidMethod(obj, mGenKeyAndCertChain,
0, 0,
name, name,
(jlong) hCryptProv, 0, (jlong) hCryptProv, (jlong) 0,
dwPublicKeyLength, jArrayList); dwPublicKeyLength, jArrayList);
} else if (buffer[0] == 'R' && buffer[2] == 'S' } else if (buffer[0] == 'R' && buffer[2] == 'S'
&& buffer[4] == 'A') { && buffer[4] == 'A') {
env->CallVoidMethod(obj, mGenKeyAndCertChain, env->CallVoidMethod(obj, mGenKeyAndCertChain,
1, 1,
name, name,
(jlong) hCryptProv, 0, (jlong) hCryptProv, (jlong) 0,
dwPublicKeyLength, jArrayList); dwPublicKeyLength, jArrayList);
} else { } else {
dump("Unknown NCRYPT_ALGORITHM_PROPERTY", buffer, len); dump("Unknown NCRYPT_ALGORITHM_PROPERTY", buffer, len);