fix invalid read
This commit is contained in:
parent
20b1c0d236
commit
820de153a8
|
@ -712,7 +712,7 @@ static int tdbBtreeBalanceNonRoot(SBTree *pBt, SPage *pParent, int idx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // Do the real cell distribution
|
{ // Do the real cell distribution
|
||||||
SPage *pOldsCopy[3];
|
SPage *pOldsCopy[3] = {0};
|
||||||
SCell *pCell;
|
SCell *pCell;
|
||||||
int szCell;
|
int szCell;
|
||||||
SBtreeInitPageArg iarg;
|
SBtreeInitPageArg iarg;
|
||||||
|
@ -722,7 +722,7 @@ static int tdbBtreeBalanceNonRoot(SBTree *pBt, SPage *pParent, int idx) {
|
||||||
iarg.pBt = pBt;
|
iarg.pBt = pBt;
|
||||||
iarg.flags = TDB_BTREE_PAGE_GET_FLAGS(pOlds[0]);
|
iarg.flags = TDB_BTREE_PAGE_GET_FLAGS(pOlds[0]);
|
||||||
for (int i = 0; i < nOlds; i++) {
|
for (int i = 0; i < nOlds; i++) {
|
||||||
tdbPageCreate(pOlds[0]->pageSize, pOldsCopy + i, NULL, NULL);
|
tdbPageCreate(pOlds[0]->pageSize, &pOldsCopy[i], NULL, NULL);
|
||||||
tdbBtreeZeroPage(pOldsCopy[i], &iarg);
|
tdbBtreeZeroPage(pOldsCopy[i], &iarg);
|
||||||
tdbPageCopy(pOlds[i], pOldsCopy[i]);
|
tdbPageCopy(pOlds[i], pOldsCopy[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ int tdbPageCreate(int pageSize, SPage **ppPage, void *(*xMalloc)(void *, size_t)
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = (u8 *)((*xMalloc)(arg, size));
|
ptr = (u8 *)((*xMalloc)(arg, size));
|
||||||
if (pPage == NULL) {
|
if (ptr == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue