Fix: Possible overwriting of custom asset blend files
The asset editing API wouldn't check if the file it's writing to is known to be managed by the asset editing API itself, and therefore writable by the API. So the API could potentially lead to custom blend files getting overridden. To be clear, all users of the API had sufficient other checks, so in practice it wouldn't happen. Still make sure the API is safe to use without requiring the caller performing extra checks.
This commit is contained in:
@@ -267,7 +267,7 @@ std::optional<std::string> asset_edit_id_save_as(Main &global_main,
|
||||
|
||||
bool asset_edit_id_save(Main &global_main, const ID &id, ReportList &reports)
|
||||
{
|
||||
if (!asset_edit_id_is_editable(id)) {
|
||||
if (!asset_edit_id_is_writable(id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user