Skip to content

Commit 58ece00

Browse files
committed
Clear out memory for rb_big_new
1 parent a38b275 commit 58ece00

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

bignum.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3055,7 +3055,9 @@ bignew_1(VALUE klass, size_t len, int sign)
30553055
VALUE
30563056
rb_big_new(size_t len, int sign)
30573057
{
3058-
return bignew(len, sign != 0);
3058+
VALUE obj = bignew(len, sign != 0);
3059+
memset(BIGNUM_DIGITS(obj), 0, len * sizeof(BDIGIT));
3060+
return obj;
30593061
}
30603062

30613063
VALUE

0 commit comments

Comments
 (0)