This is an automated email from the ASF dual-hosted git repository.
csutherl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git
The following commit(s) were added to refs/heads/main by this push:
new 7855ef1aa Lazy init stringClass in ssl.c before using to avoid crashes
7855ef1aa is described below
commit 7855ef1aac1874dcff688cdd1094069aa6ac31e6
Author: Coty Sutherland <[email protected]>
AuthorDate: Wed Dec 17 21:03:09 2025 -0500
Lazy init stringClass in ssl.c before using to avoid crashes
---
native/src/ssl.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/native/src/ssl.c b/native/src/ssl.c
index 19610d245..99769bb57 100644
--- a/native/src/ssl.c
+++ b/native/src/ssl.c
@@ -1100,6 +1100,12 @@ TCN_IMPLEMENT_CALL(jobjectArray, SSL,
getCiphers)(TCN_STDARGS, jlong ssl)
return NULL;
}
+ /* Ensure stringClass is initialized (lazy initialization) */
+ if (stringClass == NULL) {
+ jclass sClazz = (*e)->FindClass(e, "java/lang/String");
+ stringClass = (jclass) (*e)->NewGlobalRef(e, sClazz);
+ }
+
/* Create the byte[][] array that holds all the certs */
array = (*e)->NewObjectArray(e, len, stringClass, NULL);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]