Skip to content

Commit c348a4f

Browse files
committed
Avoid interger multiplication overflow
1 parent 45cd4a8 commit c348a4f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bignum.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6311,6 +6311,7 @@ rb_big_pow(VALUE x, VALUE y)
63116311

63126312
if (xbits == (size_t)-1 ||
63136313
(xbits > BIGLEN_LIMIT) ||
6314+
MUL_OVERFLOW_LONG_P(yy, xbits) ||
63146315
(xbits * yy > BIGLEN_LIMIT)) {
63156316
rb_raise(rb_eArgError, "exponent is too large");
63166317
}

0 commit comments

Comments
 (0)