RFR: 8299340: CreateProcessW lpCommandLine must be mutable [v2]

Naoto Sato naoto at openjdk.org
Fri May 12 20:52:43 UTC 2023


On Fri, 12 May 2023 19:38:53 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Launching of processes on Windows using `ProcessCreateW` with a Unicode character set requires the buffer to be writable. An access violation might occur if `ProcessCreateW` writes to the command line string. The current implementation fetches the command line string using JNI GetStringChars returning a buffer that should not be modified. The code is unchanged since 2015.  There have not been any reported faults in that time.
>> 
>> This change copies the command line to a separately allocation mutable buffer to satisfy the Windows requirement.
>
> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add unicode null to native command line copy

LGTM

-------------

Marked as reviewed by naoto (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13894#pullrequestreview-1425138318


More information about the core-libs-dev mailing list