diff options
author | dan <Dan Kennedy> | 2021-06-22 14:59:34 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2021-06-22 14:59:34 +0000 |
commit | b9f8a187deaece6a99f97de63a8a87812570d120 (patch) | |
tree | fd4815c30a0953e2ba6677a65e3c6255036ffa82 /src | |
parent | 4d2c20331a3aca0e7c4b84fd27696f5a0e304838 (diff) | |
download | sqlite-b9f8a187deaece6a99f97de63a8a87812570d120.tar.gz sqlite-b9f8a187deaece6a99f97de63a8a87812570d120.zip |
Ensure that the cell array used in balance_nonroot() is always large enough, even if the pages being balanced are corrupt.
FossilOrigin-Name: 53f64e83b39cb56ac7211ffc80d06da13318e1da9dbca7b9123954f5be229a0d
Diffstat (limited to 'src')
-rw-r--r-- | src/btree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/btree.c b/src/btree.c index 22624b5df..b764e3de6 100644 --- a/src/btree.c +++ b/src/btree.c @@ -7757,6 +7757,7 @@ static int balance_nonroot( goto balance_cleanup; } } + nMaxCells += apOld[i]->nCell + ArraySize(pParent->apOvfl); if( (i--)==0 ) break; if( pParent->nOverflow && i+nxDiv==pParent->aiOvfl[0] ){ @@ -7798,7 +7799,6 @@ static int balance_nonroot( /* Make nMaxCells a multiple of 4 in order to preserve 8-byte ** alignment */ - nMaxCells = nOld*(MX_CELL(pBt) + ArraySize(pParent->apOvfl)); nMaxCells = (nMaxCells + 3)&~3; /* |