summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-07-01 18:43:52 +0000
committerFelipe Pena <felipe@php.net>2010-07-01 18:43:52 +0000
commit01149527a962c0b322d6b3b700375e8e96c3db4b (patch)
tree566db5b62d5572a6b483fdb90a141605ea407605
parent97518d37b3dd1e6f4baf0a267672363632d1d198 (diff)
downloadphp-git-01149527a962c0b322d6b3b700375e8e96c3db4b.tar.gz
- Fixed a possible memory corruption in strrchr(). (Reported by Péter Veres)
-rw-r--r--ext/standard/string.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 6b57a7d170..71ffa24d84 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2116,6 +2116,9 @@ PHP_FUNCTION(strrchr)
FAILURE) {
WRONG_PARAM_COUNT;
}
+ if (PZVAL_IS_REF(*haystack)) {
+ SEPARATE_ZVAL(haystack);
+ }
convert_to_string_ex(haystack);
if (Z_TYPE_PP(needle) == IS_STRING) {