summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2010-06-13 21:09:51 +0200
committerantirez <antirez@gmail.com>2010-06-13 21:09:51 +0200
commitbb039e853df6c2754885c5cfb82dc3f7ea7d25b5 (patch)
tree6ca5b18ba3ae69b8a9483903af046b6cacfe5769
parenta8dca69bb31ae1ab4503e31e71e46b8d85b36dd5 (diff)
downloadredis-bb039e853df6c2754885c5cfb82dc3f7ea7d25b5.tar.gz
fixed a bug in rdbLoadObject abount specially encoded objects
-rw-r--r--redis.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/redis.c b/redis.c
index 295bec049..4f5f68a7c 100644
--- a/redis.c
+++ b/redis.c
@@ -4250,8 +4250,10 @@ static robj *rdbLoadObject(int type, FILE *fp) {
/* If we are using a zipmap and there are too big values
* the object is converted to real hash table encoding. */
if (o->encoding != REDIS_ENCODING_HT &&
- (sdslen(key->ptr) > server.hash_max_zipmap_value ||
- sdslen(val->ptr) > server.hash_max_zipmap_value))
+ ((key->encoding == REDIS_ENCODING_RAW &&
+ sdslen(key->ptr) > server.hash_max_zipmap_value) ||
+ (val->encoding == REDIS_ENCODING_RAW &&
+ sdslen(val->ptr) > server.hash_max_zipmap_value)))
{
convertToRealHash(o);
}