mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Avoid a crash that could occur when a database containing a table with a temp trigger that has the same name as a temp table is detached.
FossilOrigin-Name: c4cb9708d48ead10ee9543f86878be8382cd6e850950d5384c95254bac4a8d6e
This commit is contained in:
@@ -662,8 +662,12 @@ void sqlite3UnlinkAndDeleteTrigger(sqlite3 *db, int iDb, const char *zName){
|
||||
Table *pTab = tableOfTrigger(pTrigger);
|
||||
if( pTab ){
|
||||
Trigger **pp;
|
||||
for(pp=&pTab->pTrigger; *pp!=pTrigger; pp=&((*pp)->pNext));
|
||||
*pp = (*pp)->pNext;
|
||||
for(pp=&pTab->pTrigger; *pp; pp=&((*pp)->pNext)){
|
||||
if( *pp==pTrigger ){
|
||||
*pp = (*pp)->pNext;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sqlite3DeleteTrigger(db, pTrigger);
|
||||
|
Reference in New Issue
Block a user