summaryrefslogtreecommitdiff
path: root/hiredis.c
diff options
context:
space:
mode:
Diffstat (limited to 'hiredis.c')
-rw-r--r--hiredis.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hiredis.c b/hiredis.c
index 5888dd3..490b7ea 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -294,6 +294,13 @@ static int processMultiBulkItem(redisReader *r) {
long elements;
int root = 0;
+ /* Set error for nested multi bulks with depth > 1 */
+ if (r->ridx == 2) {
+ redisSetReplyReaderError(r,sdscatprintf(sdsempty(),
+ "No support for nested multi bulk replies with depth > 1"));
+ return -1;
+ }
+
if ((p = readLine(r,NULL)) != NULL) {
elements = strtol(p,NULL,10);
root = (r->ridx == 0);