8000 py/objstr: Sanitise the type passed to mp_obj_new_str_from_vstr. · micropython/micropython@f1c61a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit f1c61a6

Browse files
andrewleechpi-anl
authored andcommitted
py/objstr: Sanitise the type passed to mp_obj_new_str_from_vstr.
1 parent dddc5c9 commit f1c61a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

py/objstr.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,6 +2067,8 @@ mp_obj_t mp_obj_new_str_from_vstr(const mp_obj_type_t *type, vstr_t *vstr) {
20672067
vstr->alloc = 0;
20682068
return MP_OBJ_NEW_QSTR(q);
20692069
}
2070+
} else {
2071+
type = &mp_type_bytes;
20702072
}
20712073

20722074
// make a new str/bytes object

0 commit comments

Comments
 (0)
0