diff options
author | George Peter Banyard <girgias@php.net> | 2020-02-22 02:16:38 +0100 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2020-02-26 11:24:03 +0100 |
commit | c7094d892639fedffb67c273f8fd44f3ffff86d6 (patch) | |
tree | 0a4fc04b3b9fc27c9664ec22bb2cab5ac1459400 /ext/mbstring/php_mbregex.c | |
parent | b35b0142e68458475df03c24e622f1c4173ff68b (diff) | |
download | php-git-c7094d892639fedffb67c273f8fd44f3ffff86d6.tar.gz |
Fix mbstring regex variable types to correspond to Oniguruma
The beginning and ending of a Oniguruma Regex are stored in a OnigRegion (which is a typedef to the Oniguruma re_registers struct) as as int* therefore change the type from size_t to int
Closes GH-5196
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r-- | ext/mbstring/php_mbregex.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 8de9d2d302..ceda96398e 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -1390,7 +1390,9 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode) char *arg_pattern = NULL, *arg_options = NULL; size_t arg_pattern_len, arg_options_len; int err; - size_t n, i, pos, len, beg, end; + size_t n, i, pos, len; + /* Stored as int* in the OnigRegion struct */ + int beg, end; OnigOptionType option; OnigUChar *str; OnigSyntaxType *syntax; @@ -1585,7 +1587,9 @@ PHP_FUNCTION(mb_ereg_search_init) Get matched substring of the last time */ PHP_FUNCTION(mb_ereg_search_getregs) { - size_t n, i, len, beg, end; + size_t n, i, len; + /* Stored as int* in the OnigRegion struct */ + int beg, end; OnigUChar *str; if (zend_parse_parameters_none() == FAILURE) { |