RFR: 8257967: JFR: Events for loaded agents [v9]

Markus Grönlund mgronlun at openjdk.org
Thu Mar 30 19:34:26 UTC 2023


On Tue, 14 Mar 2023 12:19:50 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

>> src/hotspot/share/prims/agent.cpp line 41:
>> 
>>> 39:   char* copy = AllocateHeap(length + 1, mtInternal);
>>> 40:   strncpy(copy, str, length + 1);
>>> 41:   assert(strncmp(copy, str, length + 1) == 0, "invariant");
>> 
>> Unclear what you are checking here. Don't you trust strncpy?
>
> Maybe a bit paranoid, yes. I can clean up.

updated to use os:::strdup - cheers.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/12923#discussion_r1153702643


More information about the serviceability-dev mailing list