Miha Marolt <mi...@beyondsemi.com> writes:

  In some cases a previously freed memory is read inside the mpz_sub function. 
Here is
  an example program that demonstrates the problem:

The bug is in your code.

When passing x by value, you make copies of the two contained mpz_t
variables, including pointers.  Then you cause reallocation of the
original variables, making pointer your copies point to stale data.


-- 
Torbjörn
Please encrypt, key id 0xC8601622
_______________________________________________
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs

Reply via email to