summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-05-06 10:34:22 +0200
committerantirez <antirez@gmail.com>2014-05-07 16:17:11 +0200
commit6938a3d58f72aac2f9efdc1111d091b3399a4d3e (patch)
treeb0951f697eda7de6650c99db43aac8ad7c36791f
parent08ea98c9e9f32288d21a0caf8362342f500dcc21 (diff)
downloadredis-6938a3d58f72aac2f9efdc1111d091b3399a4d3e.tar.gz
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.
-rw-r--r--src/scripting.c1
1 files changed, 1 insertions, 0 deletions
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;