On Thu, 29 Oct 2026 01:03:48 GMT, David Holmes <[email protected]> wrote:

>> Timofei Pushkin has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Address the review
>
> src/java.instrument/share/native/libinstrument/InvocationAdapter.c line 443:
> 
>> 441: releaseAndReturn:
>> 442:     if (result != JNI_OK) {
>> 443:         destroyJPLISAgent(agent);
> 
> Same query about safety here.

Safe, same reasoning

> src/java.instrument/share/native/libinstrument/JPLISAgent.c line 270:
> 
>> 268:         return JPLIS_INIT_ERROR_ALLOCATION_FAILURE;
>> 269:     }
>> 270:     strcpy((char *) agent->mJarfile, jarfile);
> 
> strncpy for safety?

It doesn't matter here since `mJarfile` is allocated based on `strlen(jarfile)` 
above. But I replaced this with `memcpy` to make it slightly more efficient.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33608#discussion_r4409709423
PR Review Comment: https://git.openjdk.org/jdk/pull/33608#discussion_r4409704884

Reply via email to