From 6938a3d58f72aac2f9efdc1111d091b3399a4d3e Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 6 May 2014 10:34:22 +0200 Subject: Fixed missing c->bufpos reset in luaRedisGenericCommand(). Bug introduced when adding a fast path to avoid copying the reply buffer for small replies that fit into the client static buffer. --- src/scripting.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scripting.c b/src/scripting.c index 8eddb2a5e..a71622e51 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -312,6 +312,7 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) { * the client buffer directly. */ c->buf[c->bufpos] = '\0'; reply = c->buf; + c->bufpos = 0; } else { reply = sdsnewlen(c->buf,c->bufpos); c->bufpos = 0; -- cgit v1.2.1