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

Skip to content

Commit 8802467

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

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
@@ -2066,6 +2066,8 @@ mp_obj_t mp_obj_new_str_from_vstr(const mp_obj_type_t *type, vstr_t *vstr) {
20662066
vstr->alloc = 0;
20672067
return MP_OBJ_NEW_QSTR(q);
20682068
}
2069+
} else {
2070+
type = &mp_type_bytes;
20692071
}
20702072

20712073
// make a new str/bytes object

0 commit comments

Comments
 (0)
0