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

sebb pushed a commit to branch sebb-mac-test
in repository https://gitbox.apache.org/repos/asf/commons-crypto.git


The following commit(s) were added to refs/heads/sebb-mac-test by this push:
     new 732d182  Allow for adding null terminator
732d182 is described below

commit 732d1827f3e28640a5914263fad5cb3bee2c1f9c
Author: Sebb <[email protected]>
AuthorDate: Fri Jul 1 16:30:42 2022 +0100

    Allow for adding null terminator
---
 src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c 
b/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c
index 35c579c..7d30c18 100644
--- a/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c
+++ b/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c
@@ -66,7 +66,7 @@ static void get_methods(JNIEnv *env, HMODULE openssl)
   LOAD_DYNAMIC_SYMBOL_FALLBACK(dlsym_OpenSSL_version, env, openssl, 
"OpenSSL_version", "SSLeay_version");
   Dl_info info;
   (void) dladdr(dlsym_OpenSSL_version_num, &info); // ignore the return code
-  strncpy(dynamicLibraryPath, info.dli_fname, sizeof(dynamicLibraryPath));
+  strncpy(dynamicLibraryPath, info.dli_fname, sizeof(dynamicLibraryPath) - 1); 
// allow for null
 #endif
 #ifdef WINDOWS
   LOAD_DYNAMIC_SYMBOL_FALLBACK(__dlsym_OpenSSL_version_num, 
dlsym_OpenSSL_version_num, env, openssl, "OpenSSL_version_num", "SSLeay");

Reply via email to