summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_unicode.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-03-12 13:04:04 +0100
committerStanislav Malyshev <stas@php.net>2020-03-16 22:40:48 -0700
commitdb848e1482c1871d8b2a4185f0c6ac261069e4bd (patch)
tree6641c1f61eff4c6942358414934116aef843fb3b /ext/mbstring/php_unicode.c
parenta57905dbacfc4e5d94267fecf0e0f4a2798e7022 (diff)
downloadphp-git-db848e1482c1871d8b2a4185f0c6ac261069e4bd.tar.gz
Fix #79371: mb_strtolower (UTF-32LE): stack-buffer-overflow
We make sure that negative values are properly compared.
Diffstat (limited to 'ext/mbstring/php_unicode.c')
-rw-r--r--ext/mbstring/php_unicode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c
index 664f760fc3..4fa650d894 100644
--- a/ext/mbstring/php_unicode.c
+++ b/ext/mbstring/php_unicode.c
@@ -315,7 +315,7 @@ static int convert_case_filter(int c, void *void_data)
/* Handle invalid characters early, as we assign special meaning to
* codepoints above 0xffffff. */
- if (UNEXPECTED(c > 0xffffff)) {
+ if (UNEXPECTED((unsigned) c > 0xffffff)) {
(*data->next_filter->filter_function)(c, data->next_filter);
return 0;
}