From bba3cd8070f0adda905ff4c9cdbb56d82cf8d448 Mon Sep 17 00:00:00 2001 From: Will Date: Sat, 20 Apr 2013 09:43:37 +0900 Subject: [PATCH] fix buffer reallocation bug affecting Map params --- src/main/java/com/lambdaworks/redis/protocol/CommandArgs.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/lambdaworks/redis/protocol/CommandArgs.java b/src/main/java/com/lambdaworks/redis/protocol/CommandArgs.java index 4951442b55..91b5750dc3 100644 --- a/src/main/java/com/lambdaworks/redis/protocol/CommandArgs.java +++ b/src/main/java/com/lambdaworks/redis/protocol/CommandArgs.java @@ -60,7 +60,7 @@ public CommandArgs addValues(V... values) { public CommandArgs add(Map map) { if (map.size() > 2) { - realloc(16 * map.size()); + realloc(buffer.capacity() + 16 * map.size()); } for (Map.Entry entry : map.entrySet()) {