From f23302dbbfb1e9a7d9af33bf9d0914fe85d4a937 Mon Sep 17 00:00:00 2001 From: Seer Date: Mon, 30 May 2022 17:39:43 +0800 Subject: [PATCH] fix: fix bug of CheckVersionChecksum --- src/redis-shake/common/common.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/redis-shake/common/common.go b/src/redis-shake/common/common.go index e18fc05..959775b 100644 --- a/src/redis-shake/common/common.go +++ b/src/redis-shake/common/common.go @@ -10,11 +10,12 @@ import ( "unsafe" "github.com/alibaba/RedisShake/pkg/libs/bytesize" - "github.com/alibaba/RedisShake/redis-shake/configure" + conf "github.com/alibaba/RedisShake/redis-shake/configure" + + "strconv" "github.com/cupcake/rdb/crc64" logRotate "gopkg.in/natefinch/lumberjack.v2" - "strconv" ) const ( @@ -139,7 +140,7 @@ func CheckVersionChecksum(d []byte) (uint, uint64, error) { } footer := length - 10 - rdbVersion := uint((d[footer+1] << 8) | d[footer]) + rdbVersion := (uint(d[footer+1]) << 8) | uint(d[footer]) if rdbVersion > RDBVersion { return 0, 0, fmt.Errorf("current version[%v] > RDBVersion[%v]", rdbVersion, RDBVersion) }