Skip to content

Commit c7094d8

Browse files
committed
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 phpGH-5196
1 parent b35b014 commit c7094d8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ext/mbstring/php_mbregex.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,9 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
13901390
char *arg_pattern = NULL, *arg_options = NULL;
13911391
size_t arg_pattern_len, arg_options_len;
13921392
int err;
1393-
size_t n, i, pos, len, beg, end;
1393+
size_t n, i, pos, len;
1394+
/* Stored as int* in the OnigRegion struct */
1395+
int beg, end;
13941396
OnigOptionType option;
13951397
OnigUChar *str;
13961398
OnigSyntaxType *syntax;
@@ -1585,7 +1587,9 @@ PHP_FUNCTION(mb_ereg_search_init)
15851587
Get matched substring of the last time */
15861588
PHP_FUNCTION(mb_ereg_search_getregs)
15871589
{
1588-
size_t n, i, len, beg, end;
1590+
size_t n, i, len;
1591+
/* Stored as int* in the OnigRegion struct */
1592+
int beg, end;
15891593
OnigUChar *str;
15901594

15911595
if (zend_parse_parameters_none() == FAILURE) {

0 commit comments

Comments
 (0)