aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-07-30 05:00:56 +0000
committerEric Wong <normalperson@yhbt.net>2006-07-30 05:00:56 +0000
commitb38c3fa1bbd67bcae1718fc9fe0cb42a9a5d1f6c (patch)
tree5c45326eccdf346e58900d9745bb69722fc7d365 /src
parentda2d7e0c4190fc4328a97cad503866a262d793c7 (diff)
downloadmpd-b38c3fa1bbd67bcae1718fc9fe0cb42a9a5d1f6c.tar.gz
mpd-b38c3fa1bbd67bcae1718fc9fe0cb42a9a5d1f6c.tar.xz
mpd-b38c3fa1bbd67bcae1718fc9fe0cb42a9a5d1f6c.zip
command: fix find/search commands from the malloc reduction patch
The most we ever use is for search/find, and that limits it to the number of tags we can have. Add one for the command, and one extra to catch errors clients may send us. Thanks to Qball for reporting this bug git-svn-id: https://svn.musicpd.org/mpd/trunk@4486 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/command.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/command.c b/src/command.c
index 53ed8de90..b56956e74 100644
--- a/src/command.c
+++ b/src/command.c
@@ -29,6 +29,7 @@
#include "buffer2array.h"
#include "log.h"
#include "dbUtils.h"
+#include "tag.h"
#include <stdlib.h>
#include <string.h>
@@ -104,10 +105,12 @@
#define COMMAND_STATUS_AUDIO "audio"
#define COMMAND_STATUS_UPDATING_DB "updating_db"
-/* the most we ever use is argv[2], so argv[] has (at most)
- * 3 usable elements. This means we tokenize up to 4 elements to
- * detect errors clients may send us */
-#define COMMAND_ARGV_MAX 4
+/*
+ * The most we ever use is for search/find, and that limits it to the
+ * number of tags we can have. Add one for the command, and one extra
+ * to catch errors clients may send us
+ */
+#define COMMAND_ARGV_MAX (2+(TAG_NUM_OF_ITEM_TYPES*2))
typedef struct _CommandEntry CommandEntry;