From 4863ce7c8e58b19fb83b8113aef09f70ff930e9c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 5 Oct 2023 11:44:30 -0700 Subject: [PATCH] Fix binascii.crc32 unicode check --- extmod/modubinascii.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extmod/modubinascii.c b/extmod/modubinascii.c index 9c5db03a3d..f99d938c3b 100644 --- a/extmod/modubinascii.c +++ b/extmod/modubinascii.c @@ -222,6 +222,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(mod_binascii_b2a_base64_obj, 1, mod_binascii_b #if MICROPY_PY_UBINASCII_CRC32 STATIC mp_obj_t mod_binascii_crc32(size_t n_args, const mp_obj_t *args) { mp_buffer_info_t bufinfo; + // CIRCUITPY + check_not_unicode(args[0]); mp_get_buffer_raise(args[0], &bufinfo, MP_BUFFER_READ); uint32_t crc = (n_args > 1) ? mp_obj_get_int_truncated(args[1]) : 0; crc = uzlib_crc32(bufinfo.buf, bufinfo.len, crc ^ 0xffffffff);