diff options
author | stas <stas@FreeBSD.org> | 2008-06-26 07:00:28 +0800 |
---|---|---|
committer | stas <stas@FreeBSD.org> | 2008-06-26 07:00:28 +0800 |
commit | 59421ab3f26c87366e2cebb83b1aeb97eb1b843a (patch) | |
tree | c4bb00bcc5bddd03961458c59431689f2d19ab51 /lang/ruby18 | |
parent | ce05f4fa575986b95bc2f1b429f10e43e81a7009 (diff) | |
download | freebsd-ports-gnome-59421ab3f26c87366e2cebb83b1aeb97eb1b843a.tar.gz freebsd-ports-gnome-59421ab3f26c87366e2cebb83b1aeb97eb1b843a.tar.zst freebsd-ports-gnome-59421ab3f26c87366e2cebb83b1aeb97eb1b843a.zip |
- Add a couple of other patches from ruby SVN repo:
* fix integer overflow in bignums;
* correctly check for string length in regexps;
* fix memory leak in parse.c.
- Bump portrevision.
Diffstat (limited to 'lang/ruby18')
-rw-r--r-- | lang/ruby18/files/patch-bignum.c | 12 | ||||
-rw-r--r-- | lang/ruby18/files/patch-parse.c | 19 | ||||
-rw-r--r-- | lang/ruby18/files/patch-regex.c | 14 |
3 files changed, 45 insertions, 0 deletions
diff --git a/lang/ruby18/files/patch-bignum.c b/lang/ruby18/files/patch-bignum.c new file mode 100644 index 000000000000..6bb648daf0b3 --- /dev/null +++ b/lang/ruby18/files/patch-bignum.c @@ -0,0 +1,12 @@ +--- bignum.c.orig 2007-09-19 06:13:21.000000000 +0400 ++++ bignum.c 2008-06-26 01:54:38.000000000 +0400 +@@ -652,6 +652,9 @@ + if (BIGZEROP(x)) { + return rb_str_new2("0"); + } ++ if (i >= LONG_MAX/SIZEOF_BDIGITS/CHAR_BIT) { ++ rb_raise(rb_eRangeError, "bignum too big to convert into `string'"); ++ } + j = SIZEOF_BDIGITS*CHAR_BIT*i; + switch (base) { + case 2: break; diff --git a/lang/ruby18/files/patch-parse.c b/lang/ruby18/files/patch-parse.c new file mode 100644 index 000000000000..ae35f9f316ac --- /dev/null +++ b/lang/ruby18/files/patch-parse.c @@ -0,0 +1,19 @@ +--- parse.c.orig 2008-06-26 01:19:07.000000000 +0400 ++++ parse.c 2008-06-26 01:20:12.000000000 +0400 +@@ -10705,7 +10705,7 @@ + rb_mem_clear(vars+i, len-i); + } + else { +- *vars++ = (VALUE)ruby_scope; ++ *vars++ = 0; + rb_mem_clear(vars, len); + } + ruby_scope->local_vars = vars; +@@ -10721,6 +10721,7 @@ + if (!(ruby_scope->flags & SCOPE_CLONE)) + xfree(ruby_scope->local_tbl); + } ++ ruby_scope->local_vars[-1] = 0; /* no reference needed */ + ruby_scope->local_tbl = local_tbl(); + } + } diff --git a/lang/ruby18/files/patch-regex.c b/lang/ruby18/files/patch-regex.c new file mode 100644 index 000000000000..16451e45807e --- /dev/null +++ b/lang/ruby18/files/patch-regex.c @@ -0,0 +1,14 @@ +--- regex.c.orig 2008-06-26 01:17:14.000000000 +0400 ++++ regex.c 2008-06-26 01:18:42.000000000 +0400 +@@ -3169,6 +3169,11 @@ + if (startpos < 0 || startpos > size) + return -1; + ++ if (!string) { ++ if (size == 0) string = ""; ++ else return -1; ++ } ++ + /* Update the fastmap now if not correct already. */ + if (fastmap && !bufp->fastmap_accurate) { + re_compile_fastmap(bufp); |