Torbjorn Granlund <t...@gmplib.org> writes:

  There is a systematic problem in mini-gmp.c when MPZ_REALLOC is called
  when a destination variable is the same as some other (source or
  destination) variable.
  
  After MPZ_REALLOC, all cached pointers must be considered to be defunct.
  
  I've spotted this error in 4 functions, but I haven't made a proper code
  review.

This gives an idea for a testing mode allocation trick:

Let the MPZ_REALLOC macro always allocate a new block whether needed or
not, copy the data thereto, write random garbage to the old area, then
free it.  This will make any defunct pointers read data that very likely
will cause an obvious miscomputation.

-- 
Torbjörn
_______________________________________________
gmp-devel mailing list
gmp-devel@gmplib.org
http://gmplib.org/mailman/listinfo/gmp-devel

Reply via email to