Set isCopy to JNI_FALSE if len == 0

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 13
    • Affects Version/s: 13
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: