/ Check-in [99a0951f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a potential NULL pointer dereference that can occur in ALTER TABLE following an OOM. Test case in TH3.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.26
Files: files | file ages | folders
SHA3-256: 99a0951fdc80c12642dbbf0f5e744a01449395a1d2b1244cf95336145781d2e8
User & Date: drh 2018-12-06 14:11:13
Context
2018-12-06
14:24
Bump the version number to 3.26.1. check-in: e97e053b user: drh tags: branch-3.26
14:11
Fix a potential NULL pointer dereference that can occur in ALTER TABLE following an OOM. Test case in TH3. check-in: 99a0951f user: drh tags: branch-3.26
13:57
Ensure that ALTER TABLE modifies table and column names embedded in WITH clauses that are part of views and triggers. check-in: e066b4e1 user: drh tags: branch-3.26
01:53
Fix a potential NULL pointer dereference that can occur in ALTER TABLE following an OOM. Test case in TH3. check-in: ea50815b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/alter.c.

  1371   1371   /*
  1372   1372   ** Walker select callback used by "RENAME TABLE". 
  1373   1373   */
  1374   1374   static int renameTableSelectCb(Walker *pWalker, Select *pSelect){
  1375   1375     int i;
  1376   1376     RenameCtx *p = pWalker->u.pRename;
  1377   1377     SrcList *pSrc = pSelect->pSrc;
         1378  +  if( pSrc==0 ){
         1379  +    assert( pWalker->pParse->db->mallocFailed );
         1380  +    return WRC_Abort;
         1381  +  }
  1378   1382     for(i=0; i<pSrc->nSrc; i++){
  1379   1383       struct SrcList_item *pItem = &pSrc->a[i];
  1380   1384       if( pItem->pTab==p->pTab ){
  1381   1385         renameTokenFind(pWalker->pParse, p, pItem->zName);
  1382   1386       }
  1383   1387     }
  1384   1388     renameWalkWith(pWalker, pSelect);