From 5027cd7b724add7e71ec509036fec9a49a0dd84c Mon Sep 17 00:00:00 2001 From: Stanislav Sedov Date: Wed, 25 Jun 2008 23:00:28 +0000 Subject: - 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. --- lang/ruby18/files/patch-bignum.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lang/ruby18/files/patch-bignum.c (limited to 'lang/ruby18/files/patch-bignum.c') 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; -- cgit v1.2.3