Fix GH-12999: zend_strnlen build fix when platform misses strnlen support.

fix from @rainerjung
This commit is contained in:
David Carlier 2023-12-22 13:06:07 +00:00
parent 3c176d4189
commit a2068ef47b
2 changed files with 2 additions and 1 deletions

1
NEWS
View File

@ -5,6 +5,7 @@ PHP NEWS
- Core:
. Fixed bug GH-12953 (false positive SSA integrity verification failed when
loading composer classmaps with more than 11k elements). (nielsdos)
. Fixed bug GH-12999 (zend_strnlen build when strnlen is unsupported). (rainerjung)
- Cli:
. Fix incorrect timeout in built-in web server when using router script and

View File

@ -269,7 +269,7 @@ static zend_always_inline size_t zend_strnlen(const char* s, size_t maxlen)
#if defined(HAVE_STRNLEN)
return strnlen(s, maxlen);
#else
const char *p = memchr(s, '\0', maxlen);
const char *p = (const char *)memchr(s, '\0', maxlen);
return p ? p-s : maxlen;
#endif
}