From df27eeedeca42c377fbadbe77361054f241259ea Mon Sep 17 00:00:00 2001 From: Leither Date: Thu, 10 Dec 2015 12:08:14 +0800 Subject: [PATCH] Update t_list.go --- ledis/t_list.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ledis/t_list.go b/ledis/t_list.go index 33c0c04..96eefb3 100644 --- a/ledis/t_list.go +++ b/ledis/t_list.go @@ -346,7 +346,9 @@ func (db *DB) LSet(key []byte, index int32, value []byte) error { } else { seq = tailSeq + index + 1 } - + if seq < headSeq || seq > tailSeq { + return errListIndex + } sk := db.lEncodeListKey(key, seq) t.Put(sk, value) err = t.Commit()