summaryrefslogtreecommitdiffstats
path: root/devel/oniguruma5
diff options
context:
space:
mode:
authorknu <knu@FreeBSD.org>2003-11-20 05:11:20 +0000
committerknu <knu@FreeBSD.org>2003-11-20 05:11:20 +0000
commit2882a0c07c8ad08ea9b0aa8900f8d8ce40d08074 (patch)
tree5e530df254b36151e4a6417b101368fce045372d /devel/oniguruma5
parent94231ec73a0f0762e1fbb849f1d5ee5ead8b6e86 (diff)
downloadFreeBSD-ports-2882a0c07c8ad08ea9b0aa8900f8d8ce40d08074.zip
FreeBSD-ports-2882a0c07c8ad08ea9b0aa8900f8d8ce40d08074.tar.gz
Apply a patch that fixes a bug and a memory leak.
Obtained from: [ruby-dev:21973]
Diffstat (limited to 'devel/oniguruma5')
-rw-r--r--devel/oniguruma5/Makefile1
-rw-r--r--devel/oniguruma5/files/patch-ruby-dev-2197382
2 files changed, 83 insertions, 0 deletions
diff --git a/devel/oniguruma5/Makefile b/devel/oniguruma5/Makefile
index 22bb9da..a7701c2 100644
--- a/devel/oniguruma5/Makefile
+++ b/devel/oniguruma5/Makefile
@@ -7,6 +7,7 @@
PORTNAME= oniguruma
PORTVERSION= 1.9.5
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_RUBY}
MASTER_SITE_SUBDIR= contrib
diff --git a/devel/oniguruma5/files/patch-ruby-dev-21973 b/devel/oniguruma5/files/patch-ruby-dev-21973
new file mode 100644
index 0000000..a825c12
--- /dev/null
+++ b/devel/oniguruma5/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++;
+ }
OpenPOWER on IntegriCloud