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

Make MALLOC_MIN4 macro more robust

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 21
    • None
    • core-libs
    • b20
    • generic
    • generic

    Description

      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).

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: