提交 948fa60e 编写于 作者: B Benguang Zhao

fix: check the length of remaining content for computing CRC32 chksum of WAL record body

上级 63b13db1
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册