fix: check the length of remaining content for computing CRC32 chksum of WAL record body
This commit is contained in:
parent
63b13db10f
commit
948fa60ef0
|
@ -94,8 +94,10 @@ static FORCE_INLINE int64_t walScanLogGetLastVer(SWal* pWal) {
|
|||
break;
|
||||
}
|
||||
SWalCkHead* logContent = (SWalCkHead*)candidate;
|
||||
if (walValidHeadCksum(logContent) == 0 && walValidBodyCksum(logContent) == 0) {
|
||||
found = candidate;
|
||||
if (walValidHeadCksum(logContent) == 0 &&
|
||||
walCkHeadSz + logContent->head.bodyLen <= len &&
|
||||
walValidBodyCksum(logContent) == 0) {
|
||||
found = candidate;
|
||||
}
|
||||
haystack = candidate + 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue