Patch bug65947-2.patch for Filesystem function related Bug #65947
Patch version 2013-11-06 08:41 UTC
Return to Bug #65947 |
Download this patch
Patch Revisions:
Developer: laruence@php.net
diff --git a/ext/standard/string.c b/ext/standard/string.c
index c744cb4..b5f3f29 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1420,6 +1420,9 @@ PHPAPI void php_basename(const char *s, size_t len, char *suffix, size_t sufflen
c = comp = cend = (char*)s;
cnt = len;
state = 0;
+#if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
+ memset(&BG(mblen_state), 0, sizeof(BG(mblen_state)));
+#endif
while (cnt > 0) {
inc_len = (*c == '\0' ? 1: php_mblen(c, cnt));
|