replace strncpy with BLI_strncpy, in some cases strncpy was being misused since it doesnt ensure \0 termination.
also dont call CTX_data_scene() twice when checking for function arguments.
This commit is contained in:
@@ -120,7 +120,7 @@ PyObject *bpy_text_import(Text *text)
|
||||
}
|
||||
|
||||
len= strlen(text->id.name+2);
|
||||
strncpy(modulename, text->id.name+2, len);
|
||||
BLI_strncpy(modulename, text->id.name+2, len);
|
||||
modulename[len - 3]= '\0'; /* remove .py */
|
||||
return PyImport_ExecCodeModule(modulename, text->compiled);
|
||||
}
|
||||
|
Reference in New Issue
Block a user