From a19883f875fd36ba75c1121b12cef3dac5991db0 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Wed, 12 Jul 2023 01:11:26 +0200 Subject: [PATCH] Patches: do not allow empty patch names --- Utilities/bin_patch.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Utilities/bin_patch.cpp b/Utilities/bin_patch.cpp index f75455c0ee..5bdcb986f5 100644 --- a/Utilities/bin_patch.cpp +++ b/Utilities/bin_patch.cpp @@ -252,6 +252,13 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st // Each key in "Patches" is also the patch description const std::string& description = patches_entry.first.Scalar(); + if (description.empty()) + { + append_log_message(log_messages, fmt::format("Error: Empty patch name (key: %s, location: %s, file: %s)", main_key, get_yaml_node_location(patches_entry.first), path), &patch_log.error); + is_valid = false; + continue; + } + // Compile patch information if (const auto yml_type = patches_entry.second.Type(); yml_type != YAML::NodeType::Map)