From dda20542abcccac04a7f630695e6a30304f7dcf8 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Fri, 4 Jun 2010 11:32:33 +0200 Subject: [PATCH] safety assert in listTypeNext --- redis.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/redis.c b/redis.c index 30f05a63..1882d742 100644 --- a/redis.c +++ b/redis.c @@ -5029,6 +5029,9 @@ static void listTypeReleaseIterator(listTypeIterator *li) { * and advances the position of the iterator. Returns 1 when the current * entry is in fact an entry, 0 otherwise. */ static int listTypeNext(listTypeIterator *li, listTypeEntry *entry) { + /* Protect from converting when iterating */ + redisAssert(li->subject->encoding == li->encoding); + entry->li = li; if (li->encoding == REDIS_ENCODING_ZIPLIST) { entry->zi = li->zi;