On Tue, 14 Mar 2023 12:19:50 GMT, Markus Grönlund <mgron...@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