mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-20 10:10:29 +01:00
util/disk_cache: fix crash in fossilize_db
We don't need to close the file here check_files_opened_successfully() already does that for us if needed. This fixes a crash when invalid filename/paths are provided to the MESA_DISK_CACHE_READ_ONLY_FOZ_DBS environment variable. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9251>
This commit is contained in:
parent
ba4bc54dea
commit
fbabd2163d
1 changed files with 1 additions and 3 deletions
|
|
@ -282,10 +282,8 @@ foz_prepare(struct foz_db *foz_db, char *base_filename)
|
|||
free(filename);
|
||||
free(idx_filename);
|
||||
|
||||
if (!check_files_opened_successfully(foz_db->file[file_idx], db_idx)) {
|
||||
fclose(db_idx);
|
||||
if (!check_files_opened_successfully(foz_db->file[file_idx], db_idx))
|
||||
continue; /* Ignore invalid user provided filename and continue */
|
||||
}
|
||||
|
||||
if (!load_foz_dbs(foz_db, db_idx, file_idx, true)) {
|
||||
fclose(db_idx);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue