You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Aditya Bhonsle (Jira)" <ji...@apache.org> on 2023/10/11 12:16:00 UTC

[jira] [Commented] (CRYPTO-167) Cannot use env to report missing env!

    [ https://issues.apache.org/jira/browse/CRYPTO-167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17774030#comment-17774030 ] 

Aditya Bhonsle commented on CRYPTO-167:
---------------------------------------

I would like to pick this up.

> 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)