integer overflow in mpz/clear.c of GMP 5.1.3

Niels Möller nisse at
Fri Jan 17 16:18:19 UTC 2014

Vincent Lefevre <vincent at> writes:

> I think that GMP should have assertions in case the user provides
> values that are larger than supported.

There *are* such checks in mpz/realloc.c and mpz/realloc2.c, calling
abort() on too large sizes. But it appears they don't work as intended
in your case.


Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.

More information about the gmp-bugs mailing list