Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crashes from onig_new #65

Closed
skomski opened this issue Jul 10, 2016 · 2 comments
Closed

crashes from onig_new #65

skomski opened this issue Jul 10, 2016 · 2 comments
Labels

Comments

@skomski
Copy link

skomski commented Jul 10, 2016

  r = onig_new(&reg, data, data + size,
    ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, ONIG_SYNTAX_DEFAULT, &einfo);
(\2)(\1)
stack-overflow on address 0x7fffca3d5ff8 (pc 0x000000574964 bp 0x7fffca3d6110 sp 0x7fffca3d6000 T0)
    #0 0x574963 in get_min_match_length /home/skomski/Code/Onigmo/regcomp.c:2152:3
    #1 0x574dc5 in get_min_match_length /home/skomski/Code/Onigmo/regcomp.c:2188:11
    #2 0x574d1d in get_min_match_length /home/skomski/Code/Onigmo/regcomp.c:2244:8
    #3 0x57520a in get_min_match_length /home/skomski/Code/Onigmo/regcomp.c:2163:11
    #4 0x574d1d in get_min_match_length /home/skomski/Code/Onigmo/regcomp.c:2244:8
    #5 0x57520a in get_min_match_length /home/skomski/Code/Onigmo/regcomp.c:2163:11

   ...
(((?(700000))(?<y>)(())))
SEGV on unknown address 0x7ffcea194a00 (pc 0x000000572f74 bp 0x7ffcea194a00 sp 0x7ffce9ee8f80 T0)
==27959==The signal is caused by a READ memory access.
    #0 0x572f73 in renumber_by_map /home/skomski/Code/Onigmo/regcomp.c:1953:38
    #1 0x57325d in renumber_by_map /home/skomski/Code/Onigmo/regcomp.c:1943:11
    #2 0x54bf34 in disable_noname_group_capture /home/skomski/Code/Onigmo/regcomp.c:2030:7
    #3 0x5489c6 in onig_compile /home/skomski/Code/Onigmo/regcomp.c:5740:11
    #4 0x5718c4 in onig_new /home/skomski/Code/Onigmo/regcomp.c:5976:7
k-takata added a commit that referenced this issue Oct 22, 2016
Fix stack-overflow with /(\2)(\1)/.

This fix is imported from oniguruma:
kkos/oniguruma@7fe8c3f
@k-takata
Copy link
Owner

Sorry for the very late response.
The first problem is fixed in devel-6.0 branch.
The second one is still being investigated.

@k-takata k-takata added the bug label Oct 29, 2016
k-takata added a commit that referenced this issue Nov 2, 2016
After fix of #65, error code was changed from
ONIGERR_INVALID_CONDITION_PATTERN to ONIGERR_INVALID_BACKREF in this
test case.  Change the test pattern.
@k-takata
Copy link
Owner

k-takata commented Nov 2, 2016

The second one is also fixed in devel-6.0 branch. Closing.

@k-takata k-takata closed this as completed Nov 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants