php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72777 Use onig_set_match_stack_limit_size() with mbregex
Submitted: 2016-08-07 23:47 UTC Modified: 2019-04-01 07:50 UTC
From: yohgaki@php.net Assigned: yohgaki (profile)
Status: Closed Package: mbstring related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2016-08-07 23:47 UTC] yohgaki@php.net
Description:
------------
Oniguruma has
onig_set_match_stack_limit_size()
and it should be used for mbregex.

extern int main(int argc, char* argv[])
{
#define MAX_SIZE   1000000

  int len;
  int i;
  char s[MAX_SIZE];

  len = atoi(argv[1]);
  fprintf(stdout, "len: %d\n", len);
  for (i = 0; i < len; i++) {
    s[i] = ' ';
  }
  s[len] = 'a';
  s[len + 1] = '\0';

  onig_set_match_stack_limit_size(30000);

  exec(ONIG_ENCODING_UTF8, ONIG_ENCODING_UTF8, ONIG_OPTION_NONE,
       "\\s+$", s);
  return 0;
}




Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-07 23:48 UTC] yohgaki@php.net
-Assigned To: +Assigned To: yohgaki
 [2016-09-01 10:29 UTC] yohgaki@php.net
Thank you @cmb

Added PR.
Unfortunately, this does not mitigate Bug #60664 :(
 [2016-09-01 11:11 UTC] yohgaki@php.net
Added test for Bug #53099. It seems it works.
 [2016-09-04 15:12 UTC] cmb@php.net
The stack limit would also not solve bug #72970, but nonetheless I
consider introducing a way to explicitly set a stack limit a very
reasonable improvement.
 [2019-04-01 07:50 UTC] stas@php.net
-Status: Assigned +Status: Closed
 [2019-04-01 07:50 UTC] stas@php.net
This is implemented now in 7.3+
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC