diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-06-08 05:51:39 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-06-08 05:51:39 -0700 |
commit | 52929e2d1508adf1ee9f361ad5e5a60109a28c4d (patch) | |
tree | 5f4b4bf2df7aec19cda3ae42fc90e8c5e1ee4422 /mpi/mpi.c | |
parent | 9b9e5b00496e92b3240ac6be9d112c29824dc556 (diff) | |
download | txr-52929e2d1508adf1ee9f361ad5e5a60109a28c4d.tar.gz txr-52929e2d1508adf1ee9f361ad5e5a60109a28c4d.tar.bz2 txr-52929e2d1508adf1ee9f361ad5e5a60109a28c4d.zip |
Do not leave COBJ-ified mp_int uninitialized.
Here we ensure that the digits pointer of an uninitialized
mp_int is nulled out. The garbage collector could conceivably
encounter such an object, in which case mp_clear will then try
to free a garbage pointer. This could happen if an exception
is thrown out of numeric code due to low memory, interrupting
its execution, leaving behind an unfilled object produced
by make_ubignum.
* arith.c (make_ubignum): Perform minimal
initialization of the mp_int using new function.
* mpi/mpi.h (mp_init_minimal): New inline function.
Diffstat (limited to 'mpi/mpi.c')
0 files changed, 0 insertions, 0 deletions