Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8215495

Set isCopy to JNI_FALSE if len == 0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 13
    • 13
    • hotspot
    • b03

      Some JNI methods have a isCopy pointer that should be set to JNI_FALSE/JNI_TRUE if a copy is not made/made.

      If we only consider cases where the methods return non NULL elements and then look at the isCopy value, there is one corner case where isCopy is not set.

      Which means a user could mistakenly do this:
          jboolean isCopy;
          boolOrig = env->GetBooleanArrayElements(arrayOrig, &isCopy);

      and if arrayOrig is of length 0, then isCopy is not set to JNI_FALSE.

            jcbeyler Jean Christophe Beyler
            jcbeyler Jean Christophe Beyler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: