Return proper error on requests with an unbalanced number of quotes.

This commit is contained in:
Yossi Gottlieb
2013-12-08 12:57:03 +02:00
committed by antirez
parent 25ba2e9607
commit 0ff078d8d0
2 changed files with 13 additions and 0 deletions

View File

@ -868,6 +868,11 @@ int processInlineBuffer(redisClient *c) {
aux = sdsnewlen(c->querybuf,querylen);
argv = sdssplitargs(aux,&argc);
sdsfree(aux);
if (argv == NULL) {
addReplyError(c,"Protocol error: unbalanced quotes in request");
setProtocolError(c,0);
return REDIS_ERR;
}
/* Newline from slaves can be used to refresh the last ACK time.
* This is useful for a slave to ping back while loading a big