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

Arguments::create_numbered_property allocates wrong buffer in case count > 99

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 10
    • 9, 10
    • hotspot
    • None
    • b21
    • generic
    • generic

    Description

      prop_len which is used to allocate memory is not properly calculated in case count > 99.
      > size_t prop_len = strlen(prop_base_name) + strlen(prop_value) + 5;
      > int ret = jio_snprintf(property, prop_len, "%s.%d=%s", prop_base_name, count, prop_value);

      where 5 takes into account symbols '.', '=', '\0' and only 2 digits.

      as result running java with more than 100 arguments leads to
       Error: Could not create the Java Virtual Machine.
       Error: A fatal exception has occurred. Program will exit.


      Attachments

        Activity

          People

            epavlova Ekaterina Pavlova
            epavlova Ekaterina Pavlova
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: