summaryrefslogtreecommitdiff
path: root/ext/standard/php_string.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/php_string.h')
-rw-r--r--ext/standard/php_string.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h
index aa240a6036..734bf17627 100644
--- a/ext/standard/php_string.h
+++ b/ext/standard/php_string.h
@@ -138,7 +138,7 @@ php_memnstr(char *haystack, char *needle, int needle_len, char *end)
end -= needle_len;
while (p <= end) {
- if ((p = strchr(p, *needle)) && ne == p[needle_len-1]) {
+ if ((p = memchr(p, *needle, (end-p+1))) && ne == p[needle_len-1]) {
if (!memcmp(needle, p, needle_len-1)) {
return p;
}