Fix buffer overflow in BKE_bpath_foreach_path_fixed_process

It was assumed destination buffers were at least 1024 bytes which could
overflow by 256 bytes for sequencer directories. Resolve by passing the
destination buffer size to BKE_bpath_foreach_path_fixed_process.

Also remove strcpy use in foreach_path_clean_cb.
This commit is contained in:
Campbell Barton
2023-06-23 10:09:01 +10:00
parent 06cb4ca376
commit 1a04a231ec
19 changed files with 111 additions and 65 deletions

View File

@@ -89,6 +89,7 @@ static PyObject *bpy_script_paths(PyObject *UNUSED(self))
static bool bpy_blend_foreach_path_cb(BPathForeachPathData *bpath_data,
char *UNUSED(path_dst),
size_t UNUSED(path_dst_maxncpy),
const char *path_src)
{
PyObject *py_list = bpath_data->user_data;