RFR: 8345012: os::build_agent_function_name potentially wastes a byte when allocating the buffer [v3]

Thomas Stuefe stuefe at openjdk.org
Fri Nov 29 06:58:38 UTC 2024


On Fri, 29 Nov 2024 01:24:30 GMT, David Holmes <dholmes at openjdk.org> wrote:

> > I think there is a preexisting error in that `name_len` is fed as `size` parameter to `strncat`. Since the buffer is already partly filled at that point, we cannot use the full buffer size but should use the size of the remaining space in the buffer.
> 
> @tstuefe `name_len` is the length of the lib-name being concatenated, not the length of the buffer.

Okay, my fault. I thought the purpose is buffer overflow protection.

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

PR Comment: https://git.openjdk.org/jdk/pull/22404#issuecomment-2507195248


More information about the hotspot-runtime-dev mailing list