From c3a342db54596c40951db4a6b1c83eb5f8a0be62 Mon Sep 17 00:00:00 2001 From: menwen Date: Tue, 8 Mar 2022 09:20:47 +0800 Subject: [PATCH] fix panic when rdb checksum is disabled (#424) --- src/pkg/rdb/loader.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pkg/rdb/loader.go b/src/pkg/rdb/loader.go index 2b4602a..837cf6f 100644 --- a/src/pkg/rdb/loader.go +++ b/src/pkg/rdb/loader.go @@ -49,6 +49,8 @@ func (l *Loader) Footer() error { crc1 := l.crc.Sum64() if crc2, err := l.readUint64(); err != nil { return err + } else if crc2 == 0 { + log.Info("RDB file was saved with checksum disabled: no check performed.") } else if crc1 != crc2 { return errors.Errorf("checksum validation failed") }