This is an automated email from the ASF dual-hosted git repository.

csutherl pushed a commit to branch 1.3.x
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git


The following commit(s) were added to refs/heads/1.3.x by this push:
     new d12e18f21 Lazy init stringClass in ssl.c before using to avoid crashes
d12e18f21 is described below

commit d12e18f21afca1ad507baef05a0b7e5533068ff6
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 40d9c9380..61a932644 100644
--- a/native/src/ssl.c
+++ b/native/src/ssl.c
@@ -1639,6 +1639,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]

Reply via email to