From: Ethiraric Date: Tue, 4 Jun 2024 16:37:48 +0000 (+0200) Subject: coregrind: fix allocation length X-Git-Tag: VALGRIND_3_24_0~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecd6d353a5ec2fd12665947235186ab014b629e8;p=thirdparty%2Fvalgrind.git coregrind: fix allocation length The `sizeof(preload_core)` here evaluates the size of a pointer rather than the string behind it (unlike for `VG_PLATFORM` which is a macro). --- diff --git a/coregrind/m_initimg/initimg-linux.c b/coregrind/m_initimg/initimg-linux.c index c2101b15f..5359189bf 100644 --- a/coregrind/m_initimg/initimg-linux.c +++ b/coregrind/m_initimg/initimg-linux.c @@ -143,7 +143,7 @@ static HChar** setup_client_env ( HChar** origenv, const HChar* toolname, Bool u paths. We might not need the space for vgpreload_.so, but it doesn't hurt to over-allocate briefly. The 16s are just cautious slop. */ - Int preload_core_path_len = vglib_len + sizeof(preload_core) + Int preload_core_path_len = vglib_len + VG_(strlen)(preload_core) + sizeof(VG_PLATFORM) + 16; Int preload_tool_path_len = vglib_len + VG_(strlen)(toolname) + sizeof(VG_PLATFORM) + 16;