diff options
| -rw-r--r-- | ext/standard/string.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 838d5b0ded..bf59f11386 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -6120,6 +6120,10 @@ 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); |
