[
https://issues.apache.org/jira/browse/CRYPTO-167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17782940#comment-17782940
]
Sebb commented on CRYPTO-167:
-----------------------------
I now think this issue is wrong; the problem is that the code should not be
checking for a missing env.
The check is only done for calls to methods internal to the native code via the
macros LOAD_DYNAMIC_SYMBOL and LOAD_DYNAMIC_SYMBOL_FALLBACK.
> Cannot use env to report missing env!
> -------------------------------------
>
> Key: CRYPTO-167
> URL: https://issues.apache.org/jira/browse/CRYPTO-167
> Project: Commons Crypto
> Issue Type: Bug
> Reporter: Sebb
> Priority: Major
>
> There are several places (e.g. [1]) where the code does the following or
> similar:
> {code}
> if (!env || !handle) {
> THROW(env, "java/lang/InternalError", NULL);
> return NULL;
> }
> {code}
> This does not make sense, as the THROW macro tries to use the env variable to
> report the problem. This will cause a crash which may be hard to decipher. If
> the env parameter is NULL, different action should be taken if possible.
> [1]
> https://github.com/apache/commons-crypto/blob/5bb858cbcffb3aff915a6928e7761d5f33d56b6b/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h#L84
--
This message was sent by Atlassian Jira
(v8.20.10#820010)