Skip to content

Commit

Permalink
Fixed bug #23225 (money_format() didn't handle erroneous return of st…
Browse files Browse the repository at this point in the history
…rfmon)

# Initial patch proposed by marcot@tabini.ca
  • Loading branch information
Ilia Alshanetsky committed Apr 16, 2003
1 parent 56e44a4 commit 7f8bd25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ext/standard/string.c
Expand Up @@ -4372,7 +4372,10 @@ PHP_FUNCTION(money_format)

str_len = format_len + 1024;
str = emalloc(str_len);
str_len = strfmon(str, str_len, format, value);
if ((str_len = strfmon(str, str_len, format, value)) < 0) {
efree(str);
RETURN_FALSE;
}
str[str_len] = 0;

RETURN_STRINGL(erealloc(str, str_len + 1), str_len, 0);
Expand Down

0 comments on commit 7f8bd25

Please sign in to comment.