summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-04-23 10:19:43 +0200
committerantirez <antirez@gmail.com>2014-04-23 10:19:43 +0200
commitcb4e2ee9e784f23bbef1bb57c6c332dd3d2472bd (patch)
treebf6cad5889c2a5ee841dbd1724aed3a03922870f
parent20c040d364e2af83a55e70af01663f46f22e1c28 (diff)
downloadredis-cb4e2ee9e784f23bbef1bb57c6c332dd3d2472bd.tar.gz
Missing return REDIS_ERR added to processMultibulkBuffer().
When we set a protocol error we should return with REDIS_ERR to let the caller know it should stop processing the client. Bug found in a code auditing related to issue #1699.
-rw-r--r--src/networking.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/networking.c b/src/networking.c
index 9e3e4a21f..c9d211f38 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -1000,8 +1000,10 @@ int processMultibulkBuffer(redisClient *c) {
newline = strchr(c->querybuf+pos,'\r');
if (newline == NULL) {
if (sdslen(c->querybuf) > REDIS_INLINE_MAX_SIZE) {
- addReplyError(c,"Protocol error: too big bulk count string");
+ addReplyError(c,
+ "Protocol error: too big bulk count string");
setProtocolError(c,0);
+ return REDIS_ERR;
}
break;
}