From 9e8f3163924c1f429f16f44a4a27b0cd33064719 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 21 Apr 2017 16:40:57 +0300 Subject: extmod/moductypes: Fix bigint handling for 32-bit ports. --- py/objint_mpz.c | 1 + 1 file changed, 1 insertion(+) (limited to 'py/objint_mpz.c') diff --git a/py/objint_mpz.c b/py/objint_mpz.c index 2353bd8d6..d818b6f40 100644 --- a/py/objint_mpz.c +++ b/py/objint_mpz.c @@ -116,6 +116,7 @@ mp_obj_t mp_obj_int_from_bytes_impl(bool big_endian, size_t len, const byte *buf void mp_obj_int_to_bytes_impl(mp_obj_t self_in, bool big_endian, size_t len, byte *buf) { assert(MP_OBJ_IS_TYPE(self_in, &mp_type_int)); mp_obj_int_t *self = MP_OBJ_TO_PTR(self_in); + memset(buf, 0, len); mpz_as_bytes(&self->mpz, big_endian, len, buf); } -- cgit v1.2.3