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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy