From 70fe4177ab09f8917d340e699d138ac9baffad18 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Fri, 30 Sep 2011 15:26:35 +0200 Subject: [PATCH] Increment array cursor after completing nested object --- parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parser.c b/parser.c index ef75735..79d8e9a 100644 --- a/parser.c +++ b/parser.c @@ -456,13 +456,14 @@ size_t redis_parser_execute(redis_parser *parser, redis_protocol **dst, const ch /* Move to nested object when we see an incomplete array */ if (cur->type == REDIS_ARRAY && (cur->cursor < cur->size)) { RESET_PROTOCOL(&stack[++stackidx]); - cur->cursor++; break; } /* Aggregate plen for nested objects */ if (stackidx > 0) { + assert(stack[stackidx-1].type == REDIS_ARRAY); stack[stackidx-1].plen += cur->plen; + stack[stackidx-1].cursor++; } cur = &stack[--stackidx];