From 43cfda93eba8bf5e10a38fb087197bf8ad408222 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Fri, 10 Dec 2010 00:47:51 +0000 Subject: [PATCH] - Fixed bug #53512 (NumberFormatter::setSymbol crash on bogus $attr values) --- ext/intl/formatter/formatter_attr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/intl/formatter/formatter_attr.c b/ext/intl/formatter/formatter_attr.c index 851b2b310e..46d61fb1fc 100755 --- a/ext/intl/formatter/formatter_attr.c +++ b/ext/intl/formatter/formatter_attr.c @@ -311,6 +311,11 @@ PHP_FUNCTION( numfmt_set_symbol ) RETURN_FALSE; } + + if (symbol >= UNUM_FORMAT_SYMBOL_COUNT || symbol < 0) { + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "numfmt_set_symbol: invalid symbol value", 0 TSRMLS_CC ); + RETURN_FALSE; + } /* Fetch the object. */ FORMATTER_METHOD_FETCH_OBJECT; -- 2.40.0