From: Paul Floyd Date: Wed, 5 Jun 2024 06:54:16 +0000 (+0200) Subject: FreeBSD and Darwin: apply same fix as Bug 488026 X-Git-Tag: VALGRIND_3_24_0~121 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d691c75e9445d88d24b1a5595e37a991c87c298c;p=thirdparty%2Fvalgrind.git FreeBSD and Darwin: apply same fix as Bug 488026 --- diff --git a/NEWS b/NEWS index 290d60928..92e669e31 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 'guest_IP_AT_SYSCALL' 486293 memccpy false positives 486569 linux inotify_init syscall wrapper missing POST entry in syscall_table +488026 Use of `sizeof` instead of `strlen To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_initimg/initimg-darwin.c b/coregrind/m_initimg/initimg-darwin.c index 564d2fdaa..7bac7dc0d 100644 --- a/coregrind/m_initimg/initimg-darwin.c +++ b/coregrind/m_initimg/initimg-darwin.c @@ -134,7 +134,7 @@ static HChar** setup_client_env ( HChar** origenv, const HChar* toolname) 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; diff --git a/coregrind/m_initimg/initimg-freebsd.c b/coregrind/m_initimg/initimg-freebsd.c index 8c2c6b0e8..a78875ac2 100644 --- a/coregrind/m_initimg/initimg-freebsd.c +++ b/coregrind/m_initimg/initimg-freebsd.c @@ -145,7 +145,7 @@ static HChar** setup_client_env ( HChar** origenv, const HChar* toolname) 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;