diff --git a/src/gmpy2_binary.c b/src/gmpy2_binary.c index ce50501d..9789b1a5 100644 --- a/src/gmpy2_binary.c +++ b/src/gmpy2_binary.c @@ -476,6 +476,7 @@ GMPy_MPFR_To_Binary(MPFR_Object *self) /* Only need to save the precision. */ size += sizesize; TEMP_ALLOC(buffer, size); + memset(buffer, 0, size); buffer[0] = 0x04; /* Set to all 0 since we are special. */ @@ -510,6 +511,7 @@ GMPy_MPFR_To_Binary(MPFR_Object *self) /* Now process all actual numbers. */ size += (2 * sizesize) + (sizemant * (mp_bits_per_limb >> 3)); TEMP_ALLOC(buffer, size); + memset(buffer, 0, size); buffer[0] = 0x04; /* Set bit 0 to 1 since we are an actual number. */