Skip to content

Conversation

klarose
Copy link

@klarose klarose commented Aug 17, 2022

The getJVMArgs() function has two problems:

  • It uses the J2SE pointer directly, rather than its abstraction,
    leading to null pointer accesses.
  • It splits on " " without collapsing consecutive occurances of the
    token, leading to invalid arguments being passed to the JVM (e.g. the
    main class is passed in as an empty string) when the xml has
    whitespace in the java-vm-args attribute.

Fix these two problems by using the proper variable for accessing the
JavaVMArgs, and split them in a fashion that skips consecutive
whitespace.

In a similar vein, also strip whitespace in the args prior to doing this
work so that an entirely empty attribute does not lead to us
unnecessarily adding arguments.

The getJVMArgs() function has two problems:
 - It uses the J2SE pointer directly, rather than its abstraction,
   leading to null pointer accesses.
 - It splits on " " without collapsing consecutive occurances of the
   token, leading to invalid arguments being passed to the JVM (e.g. the
   main class is passed in as an empty string) when the xml has
   whitespace in the java-vm-args attribute.

Fix these two problems by using the proper variable for accessing the
JavaVMArgs, and split them in a fashion that skips consecutive
whitespace.

In a similar vein, also strip whitespace in the args prior to doing this
work so that an entirely empty attribute does not lead to us
unnecessarily adding arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant