From 7902b7aaac10c75769a33e1c0245ffaccd698523 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 29 Nov 2022 10:46:04 +0800 Subject: [PATCH] fix/tdb: remove UAF preped --- source/libs/tdb/inc/tdb.h | 1 - source/libs/tdb/src/db/tdbPager.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/source/libs/tdb/inc/tdb.h b/source/libs/tdb/inc/tdb.h index 5f9de017f0..c728e29641 100644 --- a/source/libs/tdb/inc/tdb.h +++ b/source/libs/tdb/inc/tdb.h @@ -89,7 +89,6 @@ struct STxn { void *xArg; tdb_fd_t jfd; hashset_t jPageSet; - int preped; }; // error code diff --git a/source/libs/tdb/src/db/tdbPager.c b/source/libs/tdb/src/db/tdbPager.c index ebad93eb7f..082fec4902 100644 --- a/source/libs/tdb/src/db/tdbPager.c +++ b/source/libs/tdb/src/db/tdbPager.c @@ -297,7 +297,7 @@ int tdbPagerBegin(SPager *pPager, TXN *pTxn) { } pTxn->jPageSet = hashset_create(); - ASSERT(pPager->pActiveTxn->preped == 1); + pPager->pActiveTxn = pTxn; // TODO: write the size of the file /* @@ -433,7 +433,6 @@ int tdbPagerPrepareAsyncCommit(SPager *pPager, TXN *pTxn) { tdbPCacheRelease(pPager->pCache, pPage, pTxn); } - pTxn->preped = 1; /* tdbTrace("reset dirty tree: %p", &pPager->rbt); tRBTreeCreate(&pPager->rbt, pageCmpFn); -- GitLab