skip PAGER_MJ_PGNO during cipher_integrity_check

This commit is contained in:
Stephen Lombardo 2020-11-10 16:51:20 -05:00
parent 4673c7af93
commit b0dcc5cbd0

View File

@ -1278,6 +1278,9 @@ int sqlcipher_codec_ctx_integrity_check(codec_ctx *ctx, Parse *pParse, char *col
int payload_sz = ctx->page_sz - ctx->reserve_sz + ctx->iv_sz;
int read_sz = ctx->page_sz;
/* skip integrity check on PAGER_MJ_PGNO since it will have no valid content */
if(sqlite3pager_is_mj_pgno(ctx->pBt->pBt->pPager, page)) continue;
if(page==1) {
int page1_offset = ctx->plaintext_header_sz ? ctx->plaintext_header_sz : FILE_HEADER_SZ;
read_sz = read_sz - page1_offset;