1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Earlier detection of corruption in the rtreecheck() SQL function to prevent

a (harmless) read of an uninitialized value.

FossilOrigin-Name: e2074b24788149562b15022ccd2784d6649f08ebc41410e3bfb2401baf0892e2
This commit is contained in:
drh
2020-09-17 11:56:04 +00:00
parent bc2e95140b
commit f2fa084cf1
3 changed files with 8 additions and 8 deletions

View File

@ -759,7 +759,7 @@ static int nodeAcquire(
** are the leaves, and so on. If the depth as specified on the root node
** is greater than RTREE_MAX_DEPTH, the r-tree structure must be corrupt.
*/
if( pNode && iNode==1 ){
if( pNode && rc==SQLITE_OK && iNode==1 ){
pRtree->iDepth = readInt16(pNode->zData);
if( pRtree->iDepth>RTREE_MAX_DEPTH ){
rc = SQLITE_CORRUPT_VTAB;