diff options
author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-05-23 12:44:44 +0200 |
---|---|---|
committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-05-23 13:25:42 +0200 |
commit | 86ea921291cd637fd0a7ffb0183625a5ac60e1ee (patch) | |
tree | f34cd675f2bc5a9b231bfc5a4bc197eff94544f4 /ext/intl/locale/locale_methods.c | |
parent | 07c0d714a59cb4d38664008a165bacafd754fac2 (diff) | |
download | php-git-86ea921291cd637fd0a7ffb0183625a5ac60e1ee.tar.gz |
Fixed bug #62082
This was a buffer overflow in internal function
get_icu_disp_value_src_php().
Diffstat (limited to 'ext/intl/locale/locale_methods.c')
-rwxr-xr-x | ext/intl/locale/locale_methods.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 39d162a510..1707c69f93 100755 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -527,7 +527,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME /* Get the disp_value for the given locale */ do{ - disp_name = erealloc( disp_name , buflen ); + disp_name = erealloc( disp_name , buflen * sizeof(UChar) ); disp_name_len = buflen; if( strcmp(tag_name , LOC_LANG_TAG)==0 ){ @@ -542,6 +542,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME buflen = uloc_getDisplayName ( mod_loc_name , disp_loc_name , disp_name , disp_name_len , &status); } + /* U_STRING_NOT_TERMINATED_WARNING is admissible here; don't look for it */ if( U_FAILURE( status ) ) { if( status == U_BUFFER_OVERFLOW_ERROR ) @@ -1562,11 +1563,11 @@ PHP_FUNCTION(locale_lookup) /* }}} */ /* {{{ proto string Locale::acceptFromHttp(string $http_accept) -* Tries to find out best available locale based on HTTP “Accept-Language” header +* Tries to find out best available locale based on HTTP �Accept-Language� header */ /* }}} */ /* {{{ proto string locale_accept_from_http(string $http_accept) -* Tries to find out best available locale based on HTTP “Accept-Language” header +* Tries to find out best available locale based on HTTP �Accept-Language� header */ PHP_FUNCTION(locale_accept_from_http) { |