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

Make MALLOC_MIN4 macro more robust

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • None
    • 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).

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

              Created:
              Updated:
              Resolved: