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

Fix for 6728376 causes regression if the size of "data" is 0 and malloc returns Null for 0-length

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7
    • Fix Version/s: 7
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b121
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Backports

        Description

        Hi all,

        I've found a problem in the Deflater code in OpenJDK, where a length of zero bytes is passed to malloc.

        According to the specs, malloc may return either a valid pointer that can be passed to free, or NULL, while generally NULL is considered to be a failure. Linux and Solaris, albeit non specifying it, return always a valid pointer, as far as I know, but I have a weird OS here that does indeed return NULL.

        I've fixed this issue locally, and thought I could share the patch with you:

        http://cr.openjdk.java.net/~neugens/deflater/webrev.00/

        Cheers,
        Mario

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                sherman Xueming Shen
                Reporter:
                sherman Xueming Shen
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: