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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9df7f45e CRYPTO-167 - cannot use THROW to report !env
9df7f45e is described below

commit 9df7f45ea8b61ea0ddc14f70c185b1dec2795977
Author: Sebb <[email protected]>
AuthorDate: Sun Nov 5 01:12:20 2023 +0000

    CRYPTO-167 - cannot use THROW to report !env
    
    Drop the checks instead.
    
    [skip ci]
---
 src/changes/changes.xml                                           | 1 +
 .../native/org/apache/commons/crypto/org_apache_commons_crypto.h  | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 22d0f708..dd886728 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -65,6 +65,7 @@
   <body>
     <release version="1.2.1" date="202X-MM-DD" description="Minor release 
(Java 8, OpenSSL 1.1.1)">
       <!-- FIX -->
+      <action issue="CRYPTO-167" type="fix" dev="sebb">cannot use THROW to 
report missing env</action>
       <action issue="CRYPTO-171" type="fix" dev="sebb">openssl(2) not 
supported since Sierra on macOS M1</action>
       <action                    type="fix" dev="sebb">pom.xml: copy compiler 
args for benchmarks</action>
       <action                    type="fix" dev="sebb">pom.xml: don't install 
as defaultGoal</action>
diff --git 
a/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h 
b/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h
index c26ae5f2..672f6d5d 100644
--- a/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h
+++ b/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h
@@ -92,7 +92,7 @@ HMODULE open_library(JNIEnv *env);
  */
 static __attribute__ ((unused))
 void *do_dlsym(JNIEnv *env, void *handle, const char *symbol) {
-  if (!env || !handle || !symbol) {
+  if (!handle || !symbol) {
       THROW(env, "java/lang/InternalError", NULL);
       return NULL;
   }
@@ -118,7 +118,7 @@ void *do_dlsym(JNIEnv *env, void *handle, const char 
*symbol) {
  */
 static __attribute__ ((unused))
 void *do_dlsym_fallback(JNIEnv *env, void *handle, const char *symbol, const 
char *fallback) {
-  if (!env || !handle) {
+  if (!handle) {
     THROW(env, "java/lang/InternalError", NULL);
       return NULL;
   }
@@ -208,7 +208,7 @@ static FARPROC WINAPI do_dlsym(JNIEnv *env, HMODULE handle, 
LPCSTR symbol) {
   DWORD dwErrorCode = ERROR_SUCCESS;
   FARPROC func_ptr = NULL;
 
-  if (!env || !handle || !symbol) {
+  if (!handle || !symbol) {
     THROW(env, "java/lang/InternalError", NULL);
     return NULL;
   }
@@ -241,7 +241,7 @@ static FARPROC WINAPI do_dlsym_fallback(JNIEnv *env, 
HMODULE handle, LPCSTR symb
   DWORD dwErrorCode = ERROR_SUCCESS;
   FARPROC func_ptr = NULL;
 
-  if (!env || !handle || !symbol) {
+  if (!handle || !symbol) {
     THROW(env, "java/lang/InternalError", NULL);
     return NULL;
   }

Reply via email to