diff options
author | Max Kellermann <max@duempel.org> | 2014-04-24 08:13:20 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-04-24 08:19:08 +0200 |
commit | c9aec3e8666628c87b55657ae506a1bd4d27859d (patch) | |
tree | 9684c6572ab957e831704af9a26fdebd8279acf9 /src/command | |
parent | 1d1f8be26070aea8bfc79a4f43d0e7a5343f60d9 (diff) | |
download | mpd-c9aec3e8666628c87b55657ae506a1bd4d27859d.tar.gz mpd-c9aec3e8666628c87b55657ae506a1bd4d27859d.tar.xz mpd-c9aec3e8666628c87b55657ae506a1bd4d27859d.zip |
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().
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/DatabaseCommands.cxx | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/command/DatabaseCommands.cxx b/src/command/DatabaseCommands.cxx index 919838e67..7126fc855 100644 --- a/src/command/DatabaseCommands.cxx +++ b/src/command/DatabaseCommands.cxx @@ -173,17 +173,12 @@ handle_list(Client &client, int argc, char *argv[]) { unsigned tagType = locate_parse_type(argv[1]); - if (tagType == TAG_NUM_OF_ITEM_TYPES) { + if (tagType >= TAG_NUM_OF_ITEM_TYPES && + tagType != LOCATE_TAG_FILE_TYPE) { command_error(client, ACK_ERROR_ARG, "\"%s\" is not known", argv[1]); return CommandResult::ERROR; } - if (tagType == LOCATE_TAG_ANY_TYPE) { - command_error(client, ACK_ERROR_ARG, - "\"any\" is not a valid return tag type"); - return CommandResult::ERROR; - } - SongFilter *filter; if (argc == 3) { /* for compatibility with < 0.12.0 */ |