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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9, 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b21
    • CPU:
      generic
    • OS:
      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

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

              Dates

              Created:
              Updated:
              Resolved: