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

markt 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 42803d725 Fix buf size
42803d725 is described below

commit 42803d7250f946893dddd3ffd94c8afa384a4d6d
Author: Chenjp <[email protected]>
AuthorDate: Tue Jan 27 14:03:58 2026 +0800

    Fix buf size
    
    Reduce unused mem
---
 native/src/ssl.c                  | 2 +-
 native/src/sslcontext.c           | 2 +-
 xdocs/miscellaneous/changelog.xml | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/native/src/ssl.c b/native/src/ssl.c
index 335da50c6..4faae7f55 100644
--- a/native/src/ssl.c
+++ b/native/src/ssl.c
@@ -1687,7 +1687,7 @@ TCN_IMPLEMENT_CALL(jboolean, SSL, 
setCipherSuites)(TCN_STDARGS, jlong ssl,
      *  no matter what was given in the config.
      */
     len = strlen(J2S(cipherList)) + strlen(SSL_CIPHERS_ALWAYS_DISABLED) + 1;
-    buf = malloc(len * sizeof(char *));
+    buf = malloc(len * sizeof(char));
     if (buf == NULL) {
         rv = JNI_FALSE;
         goto free_cipherList;
diff --git a/native/src/sslcontext.c b/native/src/sslcontext.c
index e703a53aa..e832590a7 100644
--- a/native/src/sslcontext.c
+++ b/native/src/sslcontext.c
@@ -542,7 +542,7 @@ TCN_IMPLEMENT_CALL(jboolean, SSLContext, 
setCipherSuite)(TCN_STDARGS, jlong ctx,
      *  no matter what was given in the config.
      */
     len = strlen(J2S(cipherList)) + strlen(SSL_CIPHERS_ALWAYS_DISABLED) + 1;
-    buf = malloc(len * sizeof(char *));
+    buf = malloc(len * sizeof(char));
     if (buf == NULL) {
         rv = JNI_FALSE;
         goto free_cipherList;
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 6792d07a4..1e9004353 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -39,7 +39,8 @@
     </scode>
     <fix>
       Fix unnecessarily large buffer allocation when filtering out NULL and
-      export ciphers. Pull request <pr>35</pr> provided by chenjp. (markt)
+      export ciphers. Pull requests <pr>35</pr> and <pr>37</pr> provided by
+      chenjp. (markt)
     </fix>
     <fix>
       Fix a potential memory leak if an invalid <code>OpenSSLConf</code> is


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to