We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b32a2a5 + 8844427 commit 3ac4329Copy full SHA for 3ac4329
1 file changed
Zend/zend_string.c
@@ -500,8 +500,10 @@ ZEND_API zend_string *zend_string_concat3(
500
return res;
501
}
502
503
-/* strlcpy and strlcat are not intercepted by msan, so we need to do it ourselves. */
504
-#if __has_feature(memory_sanitizer)
+/* strlcpy and strlcat are not always intercepted by msan, so we need to do it
+ * ourselves. Apply a simple heuristic to determine the platforms that need it.
505
+ * See https://github.com/php/php-src/issues/20002. */
506
+#if __has_feature(memory_sanitizer) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__APPLE__)
507
static size_t (*libc_strlcpy)(char *__restrict, const char *__restrict, size_t);
508
size_t strlcpy(char *__restrict dest, const char *__restrict src, size_t n)
509
{
0 commit comments