mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-26 23:00:38 +00:00
8035759: [parfait] JNI exception pending in jdk/src/windows/native/sun/security/krb5/NativeCreds.c
Reviewed-by: valeriep
This commit is contained in:
parent
037c46281a
commit
76e336a948
@ -463,6 +463,10 @@ JNIEXPORT jobject JNICALL Java_sun_security_krb5_Credentials_acquireDefaultNativ
|
||||
netypes = (*env)->GetArrayLength(env, jetypes);
|
||||
etypes = (jint *) (*env)->GetIntArrayElements(env, jetypes, NULL);
|
||||
|
||||
if (etypes == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
// check TGT validity
|
||||
if (native_debug) {
|
||||
printf("LSA: TICKET SessionKey KeyType is %d\n", msticket->SessionKey.KeyType);
|
||||
@ -952,8 +956,7 @@ jobject BuildPrincipal(JNIEnv *env, PKERB_EXTERNAL_NAME principalName,
|
||||
if (native_debug) {
|
||||
printf("LSA: Can't allocate String array for Principal\n");
|
||||
}
|
||||
LocalFree(realm);
|
||||
return principal;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
for (i=0; i<nameCount; i++) {
|
||||
@ -963,18 +966,32 @@ jobject BuildPrincipal(JNIEnv *env, PKERB_EXTERNAL_NAME principalName,
|
||||
// OK, got a Char array, so construct a String
|
||||
tempString = (*env)->NewString(env, (const jchar*)scanner->Buffer,
|
||||
scanner->Length/sizeof(WCHAR));
|
||||
|
||||
if (tempString == NULL) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
// Set the String into the StringArray
|
||||
(*env)->SetObjectArrayElement(env, stringArray, i, tempString);
|
||||
|
||||
if ((*env)->ExceptionCheck(env)) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
// Do I have to worry about storage reclamation here?
|
||||
}
|
||||
// now set the realm in the principal
|
||||
realmLen = (ULONG)wcslen((PWCHAR)realm);
|
||||
realmStr = (*env)->NewString(env, (PWCHAR)realm, (USHORT)realmLen);
|
||||
|
||||
if (realmStr == NULL) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
principal = (*env)->NewObject(env, principalNameClass,
|
||||
principalNameConstructor, stringArray, realmStr);
|
||||
|
||||
cleanup:
|
||||
// free local resources
|
||||
LocalFree(realm);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user