mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
There are two calls to mp_builtin___import__(): 1. ports/unix/main.c:main_() which provides a str in args[0] 2. py/runtime.c:mp_import_name() which provides a qstr in args[0] The default implementation of mp_builtin___import__() is mp_builtin___import___default() which has a different implementation based on MICROPY_ENABLE_EXTERNAL_IMPORT. If MICROPY_ENABLE_EXTERNAL_IMPORT is disabled then the handling of weak links assumes that args[0] is a `const char *`, when it is either a str or qstr object. Use the existing qstr of the module name instead, and also use a vstr instead of strcpy() to ensure no overflow occurs.
24 KiB
24 KiB