From c9aec3e8666628c87b55657ae506a1bd4d27859d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 24 Apr 2014 08:13:20 +0200 Subject: DatabaseCommands: fix crash on "list base" The string "base" is understood by locate_parse_type(), but not by listAllUniqueTags(). The special tag type LOCATE_TAG_BASE_TYPE causes a crash in PrintUniqueTag(). --- src/db/DatabasePrint.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/db') diff --git a/src/db/DatabasePrint.cxx b/src/db/DatabasePrint.cxx index 2a13b28e6..781866272 100644 --- a/src/db/DatabasePrint.cxx +++ b/src/db/DatabasePrint.cxx @@ -261,6 +261,8 @@ listAllUniqueTags(Client &client, unsigned type, std::ref(client), _1); return db->Visit(selection, f, error); } else { + assert(type < TAG_NUM_OF_ITEM_TYPES); + using namespace std::placeholders; const auto f = std::bind(PrintUniqueTag, std::ref(client), (TagType)type, _1); -- cgit v1.2.3