mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
extmod/moductypes: Validate that uctypes.struct addr argument is an int.
Fixes issue #12660. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -96,7 +96,7 @@ STATIC NORETURN void syntax_error(void) {
|
||||
STATIC mp_obj_t uctypes_struct_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
|
||||
mp_arg_check_num(n_args, n_kw, 2, 3, false);
|
||||
mp_obj_uctypes_struct_t *o = mp_obj_malloc(mp_obj_uctypes_struct_t, type);
|
||||
o->addr = (void *)(uintptr_t)mp_obj_int_get_truncated(args[0]);
|
||||
o->addr = (void *)(uintptr_t)mp_obj_get_int_truncated(args[0]);
|
||||
o->desc = args[1];
|
||||
o->flags = LAYOUT_NATIVE;
|
||||
if (n_args == 3) {
|
||||
|
||||
Reference in New Issue
Block a user