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:
parent
93ca0444f3
commit
bceb1adb20
@ -153,7 +153,7 @@ void AssetList::setup()
|
|||||||
const bool use_asset_indexer = !USER_EXPERIMENTAL_TEST(&U, no_asset_indexing);
|
const bool use_asset_indexer = !USER_EXPERIMENTAL_TEST(&U, no_asset_indexing);
|
||||||
filelist_setindexer(files, use_asset_indexer ? &file_indexer_asset : &file_indexer_noop);
|
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()) {
|
if (!asset_lib_path.empty()) {
|
||||||
STRNCPY(path, asset_lib_path.c_str());
|
STRNCPY(path, asset_lib_path.c_str());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user