Make MALLOC_MIN4 macro more robust

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 21
    • Affects Version/s: None
    • Component/s: core-libs
    • b20
    • generic
    • generic

      In the file `src/java.base/share/native/libjava/jni_util.c`, there is a macro for calculating minimum buffer size `MALLOC_MIN4`. While all current uses of the MALLOC_MIN4 macro are with a parameter of jint type, the macro itself is parameter type agnostic. This check can be more strict —at no computational cost— and prevent mistakes if there were a future use with a data type greater than jint (i.e. jlong).

            Assignee:
            Naoto Sato
            Reporter:
            Naoto Sato
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: