Fix a possible NULL pointer dereference when applying a DROP COLUMN to a
corrupt database schema. dbsqlfuzz 419aa525df93db6e463772c686ac6da27b46da9e FossilOrigin-Name: 349ccf58ae4bb770805066102fc8e9e478d4da1f7a6a728223bd74eabf7b7843
This commit is contained in:
+1
-1
@@ -1807,7 +1807,7 @@ static void dropColumnFunc(
|
||||
rc = renameParseSql(&sParse, zDb, db, zSql, iSchema==1);
|
||||
if( rc!=SQLITE_OK ) goto drop_column_done;
|
||||
pTab = sParse.pNewTable;
|
||||
if( pTab->nCol==1 || iCol>=pTab->nCol ){
|
||||
if( pTab==0 || pTab->nCol==1 || iCol>=pTab->nCol ){
|
||||
/* This can happen if the sqlite_schema table is corrupt */
|
||||
rc = SQLITE_CORRUPT_BKPT;
|
||||
goto drop_column_done;
|
||||
|
||||
Reference in New Issue
Block a user