/ Check-in [ea50815b]
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 | trunk
Files: files | file ages | folders
SHA3-256: ea50815bf80ab0d36891518f209acbcd3d6d8d84529741bffd4e841874c78aff
User & Date: drh 2018-12-06 01:53:12
Context
2018-12-06
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
02:01
Remove the unused pColHash field from the Table object. check-in: 3a2c0479 user: drh tags: trunk
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
01:08
Fix a missing mutex in the sqlite3_normalized_sql() interface when it is called on a prepared statement that did not previously have a computed normalization of the input SQL. check-in: 1a1a59c6 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);