From bceb1adb203b51e94c561476b1cadf1b449dccbf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 23 May 2023 11:21:10 +1000 Subject: [PATCH] Fix potential buffer overflow in AssetList::setup While in practice an overflow seems unlikely in this particular case, internal path manipulation assume FILE_MAX_LIBEXTRA so passing in smaller buffer sizes is error prone. --- source/blender/editors/asset/intern/asset_list.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/asset/intern/asset_list.cc b/source/blender/editors/asset/intern/asset_list.cc index 17d9e134660..3a2b7d1755f 100644 --- a/source/blender/editors/asset/intern/asset_list.cc +++ b/source/blender/editors/asset/intern/asset_list.cc @@ -153,7 +153,7 @@ void AssetList::setup() const bool use_asset_indexer = !USER_EXPERIMENTAL_TEST(&U, no_asset_indexing); filelist_setindexer(files, use_asset_indexer ? &file_indexer_asset : &file_indexer_noop); - char path[FILE_MAXDIR] = ""; + char path[FILE_MAX_LIBEXTRA] = ""; if (!asset_lib_path.empty()) { STRNCPY(path, asset_lib_path.c_str()); }