Skip to content

Commit a2068ef

Browse files
committed
Fix GH-12999: zend_strnlen build fix when platform misses strnlen support.
fix from @rainerjung
1 parent 3c176d4 commit a2068ef

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Diff for: NEWS

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ PHP NEWS
55
- Core:
66
. Fixed bug GH-12953 (false positive SSA integrity verification failed when
77
loading composer classmaps with more than 11k elements). (nielsdos)
8+
. Fixed bug GH-12999 (zend_strnlen build when strnlen is unsupported). (rainerjung)
89

910
- Cli:
1011
. Fix incorrect timeout in built-in web server when using router script and

Diff for: Zend/zend_operators.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static zend_always_inline size_t zend_strnlen(const char* s, size_t maxlen)
269269
#if defined(HAVE_STRNLEN)
270270
return strnlen(s, maxlen);
271271
#else
272-
const char *p = memchr(s, '\0', maxlen);
272+
const char *p = (const char *)memchr(s, '\0', maxlen);
273273
return p ? p-s : maxlen;
274274
#endif
275275
}

0 commit comments

Comments
 (0)