diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2007-09-07 02:28:26 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2007-09-07 02:28:26 +0000 |
| commit | b9071080f8ca6466569ee893997c23bf3c0ad440 (patch) | |
| tree | c7bc7113f1ab07ad87328f970c5a496da4e7b35d | |
| parent | 2ee3da29c58daf1c814200e84e7ecd59218491f3 (diff) | |
| download | php-git-b9071080f8ca6466569ee893997c23bf3c0ad440.tar.gz | |
Added missing safety checks for 2nd parameter of setlocale() function
| -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); |
