summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r--ext/standard/string.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index e7b36a27ac..71e70af42a 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -4000,8 +4000,12 @@ PHP_FUNCTION(setlocale)
loc = NULL;
} else {
loc = Z_STRVAL_PP(plocale);
+ if (Z_STRLEN_PP(plocale) >= 255) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Specified locale name is too long");
+ break;
+ }
}
-
+
retval = setlocale (cat, loc);
zend_update_current_locale();
if (retval) {