Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Zend/zend_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,11 @@ ZEND_API zend_string *zend_string_concat3(
return res;
}

/* strlcpy and strlcat are not intercepted by msan, so we need to do it ourselves. */
#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 tell if the platform needs it,
* see https://github.com/php/php-src/issues/20002 */
#if __has_feature(memory_sanitizer) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__APPLE__)
static size_t (*libc_strlcpy)(char *__restrict, const char *__restrict, size_t);
size_t strlcpy(char *__restrict dest, const char *__restrict src, size_t n)
{
Expand Down