summaryrefslogtreecommitdiff
path: root/ext/standard/php_string.h
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2002-10-11 14:48:25 +0000
committerIlia Alshanetsky <iliaa@php.net>2002-10-11 14:48:25 +0000
commitb7917def1346ef0374c551df7e9b056c803db324 (patch)
treec9676916935607a32bbd1c4f56cb525800e2d1d6 /ext/standard/php_string.h
parent0e384b473bd71ffac3bd0ae22c8d5f0c4add9de1 (diff)
downloadphp-git-b7917def1346ef0374c551df7e9b056c803db324.tar.gz
Fixed bug #19865
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;
}