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
This commit is contained in:
Eric Wong
2006-07-30 05:00:56 +00:00
parent da2d7e0c41
commit b38c3fa1bb

View File

@@ -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;