diff options
Diffstat (limited to 'devel/oniguruma/files/patch-ruby-dev-21973')
-rw-r--r-- | devel/oniguruma/files/patch-ruby-dev-21973 | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/devel/oniguruma/files/patch-ruby-dev-21973 b/devel/oniguruma/files/patch-ruby-dev-21973 new file mode 100644 index 000000000000..a825c121c31c --- /dev/null +++ b/devel/oniguruma/files/patch-ruby-dev-21973 @@ -0,0 +1,82 @@ +Taken from: [ruby-dev:21973] + +Index: regparse.c +=================================================================== +--- regparse.c (.../ags/oniguruma/1.9.5) (revision 245) ++++ regparse.c (.../runk/oniguruma) (revision 245) +@@ -833,6 +833,10 @@ + e->back_refs = (int* )NULL; + } + } ++ if (IS_NOT_NULL(t->e)) { ++ xfree(t->e); ++ t->e = NULL; ++ } + t->num = 0; + } + return 0; +@@ -3611,6 +3615,7 @@ + enum CCVALTYPE val_type, in_type; + int val_israw, in_israw; + ++ prev_cc = (CClassNode* )NULL; + *np = NULL_NODE; + r = fetch_token_in_cc(tok, src, end, env); + if (r == TK_BYTE && tok->u.c == '^') { +@@ -3633,7 +3638,6 @@ + *np = node = node_new_cclass(); + CHECK_NULL_RETURN_VAL(node, REGERR_MEMORY); + cc = &(NCCLASS(node)); +- prev_cc = (CClassNode* )NULL; + + and_start = 0; + state = CCS_START; +@@ -3810,6 +3814,7 @@ + if (IS_NOT_NULL(prev_cc)) { + r = and_cclass(prev_cc, cc); + if (r != 0) goto err; ++ bbuf_free(cc->mbuf); + } + else { + prev_cc = cc; +@@ -3846,6 +3851,7 @@ + if (IS_NOT_NULL(prev_cc)) { + r = and_cclass(prev_cc, cc); + if (r != 0) goto err; ++ bbuf_free(cc->mbuf); + cc = prev_cc; + } + +@@ -3864,6 +3870,8 @@ + return 0; + + err: ++ if (cc != &(NCCLASS(*np))) ++ bbuf_free(cc->mbuf); + regex_node_free(*np); + return r; + } +@@ -4490,7 +4498,10 @@ + + *top = NULL; + r = parse_branch(&node, tok, term, src, end, env); +- if (r < 0) return r; ++ if (r < 0) { ++ regex_node_free(node); ++ return r; ++ } + + if (r == term) { + *top = node; +Index: regcomp.c +=================================================================== +--- regcomp.c (.../ags/oniguruma/1.9.5) (revision 245) ++++ regcomp.c (.../runk/oniguruma) (revision 245) +@@ -3675,6 +3675,7 @@ + } + else { + len = mblen(code, *p); ++ if (i + len > OPT_EXACT_MAXLEN) break; + for (j = 0; j < len; j++) + to->s[i++] = *p++; + } |