ext/gmp: Fix crash in gmp_pow with excessively large exponent#22352
ext/gmp: Fix crash in gmp_pow with excessively large exponent#22352arshidkv12 wants to merge 3 commits into
Conversation
|
Two concerns before this lands. The It also caps only the exponent, not the result size. The GMP abort is driven by |
Thank you. Good points — agreed, the 1,000,000 cap is arbitrary and can reject valid cases like I think the issue is caused by this calculation: mpz/n_pow_ui.c:371 ralloc = (bsize * GMP_NUMB_BITS - cnt + GMP_NAIL_BITS) * e / GMP_NUMB_BITS + 5; |
#22351