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

Accessing byte field using SetIntFIeld in Java_jdk_internal_org_jline_terminal_impl_jna_linux_CLibraryImpl_tcgetattr

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 21-pool
    • 21, 22
    • core-libs
    • None
    • 21

      In Java_jdk_internal_org_jline_terminal_impl_jna_linux_CLibraryImpl_tcgetattr a field is accessed incorrectly from JNI.

        data.c_line = env->GetIntField(input, c_line);
        env->SetIntField(result, c_line, data.c_line);

      But the c_line field is a byte field e.g. c_line = env->GetFieldID(termios_j, "c_line", "B");

      This was detected by Espresso (alternative JVM implementation) which is strict on the fields types when accessed via JNI.

            jlahoda Jan Lahoda
            apeterssen Alfonso Alfonso Peterssen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: