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.
This commit is contained in:
Campbell Barton 2023-05-23 11:21:10 +10:00
parent 93ca0444f3
commit bceb1adb20

View File

@ -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());
}