You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (Jira)" <ji...@apache.org> on 2022/06/30 16:29:00 UTC

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

Sebb created CRYPTO-167:
---------------------------

             Summary: 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


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)