RFR: 8341792: Fix ExceptionOccurred in java.security.jgss

Justin Lu jlu at openjdk.org
Wed Oct 9 17:30:59 UTC 2024


On Wed, 9 Oct 2024 16:22:13 GMT, Weijun Wang <weijun at openjdk.org> wrote:

> Switch to `ExceptionCheck`.
> 
> This is a part of an umbrella bug [JDK-8341542 JNI uses of ExceptionOccurred() treated as if function returns a bool](https://bugs.openjdk.org/browse/JDK-8341542).

src/java.security.jgss/macosx/native/libosxkrb5/SCDynamicStoreConfig.m line 54:

> 52:         CHECK_NULL(jm_Config_refresh);
> 53:         (*env)->CallStaticVoidMethod(env, jc_Config, jm_Config_refresh);
> 54:         if ((*env)->ExceptionOccurred(env) != NULL) {

I believe we can keep the original behavior if you want to, because its being compared to `NULL` and not as a boolean.

> Returns the exception object that is currently in the process of being thrown, or NULL if no exception is currently being thrown.

But the new code might read better. So I guess it is just preference.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21424#discussion_r1793895480


More information about the security-dev mailing list