From fb1e656935342ce7ba1eb4e353d9a525c813e700 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Fri, 3 Jan 2025 15:56:35 +0300 Subject: [PATCH] XXX --- src/gmpy2_binary.c | 2 ++ 1 file changed, 2 insertions(+) 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. */