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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 10
    • Affects Version/s: 9, 10
    • Component/s: hotspot
    • None
    • b21
    • generic
    • generic

      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.


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

              Created:
              Updated:
              Resolved: