summaryrefslogtreecommitdiff
path: root/lang/ruby18/files/patch-bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'lang/ruby18/files/patch-bignum.c')
-rw-r--r--lang/ruby18/files/patch-bignum.c12
1 files changed, 12 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;