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()