Skip to content

Commit b0dcc5c

Browse files
committed
skip PAGER_MJ_PGNO during cipher_integrity_check
1 parent 4673c7a commit b0dcc5c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/crypto_impl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,9 @@ int sqlcipher_codec_ctx_integrity_check(codec_ctx *ctx, Parse *pParse, char *col
12781278
int payload_sz = ctx->page_sz - ctx->reserve_sz + ctx->iv_sz;
12791279
int read_sz = ctx->page_sz;
12801280

1281+
/* skip integrity check on PAGER_MJ_PGNO since it will have no valid content */
1282+
if(sqlite3pager_is_mj_pgno(ctx->pBt->pBt->pPager, page)) continue;
1283+
12811284
if(page==1) {
12821285
int page1_offset = ctx->plaintext_header_sz ? ctx->plaintext_header_sz : FILE_HEADER_SZ;
12831286
read_sz = read_sz - page1_offset;

0 commit comments

Comments
 (0)