This is an automated email from the ASF dual-hosted git repository.
markt 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 b72a4e32b Fix buf size
b72a4e32b is described below
commit b72a4e32bfad2a8798e1f3b7f0166e69e6ee8af0
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 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/native/src/ssl.c b/native/src/ssl.c
index 215f9d08b..4b8d7fd43 100644
--- a/native/src/ssl.c
+++ b/native/src/ssl.c
@@ -1148,7 +1148,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 87c3312b8..30ae7deb5 100644
--- a/native/src/sslcontext.c
+++ b/native/src/sslcontext.c
@@ -541,7 +541,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;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]