Accessing byte field using SetIntFIeld in Java_jdk_internal_org_jline_terminal_impl_jna_linux_CLibraryImpl_tcgetattr

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • 21-pool-oracle
    • Affects Version/s: 21, 22
    • Component/s: 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.

            Assignee:
            Jan Lahoda
            Reporter:
            Alfonso Alfonso Peterssen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: