Skip to content

Commit

Permalink
- Fixed a possible interruption array leak in trim()
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Jul 2, 2010
1 parent 22dcb61 commit d71b9d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion NEWS
Expand Up @@ -6,7 +6,7 @@ PHP NEWS
- Fixed a possible interruption array leak in strrchr(). Reported by
Péter Veres. (Felipe)
- Fixed a possible interruption array leak in strchr(), strstr(), substr(),
chunk_split(), strtok(), addcslashes(), str_repeat(). (Felipe)
chunk_split(), strtok(), addcslashes(), str_repeat(), trim(). (Felipe)
- Fixed a possible memory corruption in substr_replace() (Dmitry)
- Fixed SplObjectStorage unserialization problems (CVE-2010-2225). (Stas)

Expand Down
3 changes: 3 additions & 0 deletions ext/standard/string.c
Expand Up @@ -774,6 +774,9 @@ static void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mode)
WRONG_PARAM_COUNT;
}

if (PZVAL_IS_REF(*str)) {
SEPARATE_ZVAL(str);
}
convert_to_string_ex(str);

if (argc > 1) {
Expand Down

0 comments on commit d71b9d5

Please sign in to comment.