SQLite

Check-in [b94a3a37df]
Login

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

Overview
Comment:Fix a potential use-after-free problem when compiling with SQLITE_HAS_CODEC.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | branch-3.10
Files: files | file ages | folders
SHA1: b94a3a37df9472be477305fc6309f69f8a3a65e9
User & Date: drh 2016-01-20 15:05:35.493
Context
2016-01-20
15:08
Fix the build so that it works for SQLITE_OMIT_WAL again. (check-in: d1c15de516 user: drh tags: branch-3.10)
15:05
Fix a potential use-after-free problem when compiling with SQLITE_HAS_CODEC. (check-in: b94a3a37df user: drh tags: branch-3.10)
14:32
Increase version number to 3.10.2. (check-in: c1f918dcc1 user: drh tags: branch-3.10)
2016-01-16
03:16
Fix a potential use-after-free problem when compiling with SQLITE_HAS_CODEC. (check-in: 653ea15ad8 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
  /* Enable the lookaside-malloc subsystem */
  setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside,
                        sqlite3GlobalConfig.nLookaside);

  sqlite3_wal_autocheckpoint(db, SQLITE_DEFAULT_WAL_AUTOCHECKPOINT);

opendb_out:
  sqlite3_free(zOpen);
  if( db ){
    assert( db->mutex!=0 || isThreadsafe==0
           || sqlite3GlobalConfig.bFullMutex==0 );
    sqlite3_mutex_leave(db->mutex);
  }
  rc = sqlite3_errcode(db);
  assert( db!=0 || rc==SQLITE_NOMEM );







<







2966
2967
2968
2969
2970
2971
2972

2973
2974
2975
2976
2977
2978
2979
  /* Enable the lookaside-malloc subsystem */
  setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside,
                        sqlite3GlobalConfig.nLookaside);

  sqlite3_wal_autocheckpoint(db, SQLITE_DEFAULT_WAL_AUTOCHECKPOINT);

opendb_out:

  if( db ){
    assert( db->mutex!=0 || isThreadsafe==0
           || sqlite3GlobalConfig.bFullMutex==0 );
    sqlite3_mutex_leave(db->mutex);
  }
  rc = sqlite3_errcode(db);
  assert( db!=0 || rc==SQLITE_NOMEM );
3003
3004
3005
3006
3007
3008
3009

3010
3011
3012
3013
3014
3015
3016
        iByte = (iByte<<4) + sqlite3HexToInt(zHexKey[i]);
        if( (i&1)!=0 ) zKey[i/2] = iByte;
      }
      sqlite3_key_v2(db, 0, zKey, i/2);
    }
  }
#endif

  return rc & 0xff;
}

/*
** Open a new database handle.
*/
int sqlite3_open(







>







3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
        iByte = (iByte<<4) + sqlite3HexToInt(zHexKey[i]);
        if( (i&1)!=0 ) zKey[i/2] = iByte;
      }
      sqlite3_key_v2(db, 0, zKey, i/2);
    }
  }
#endif
  sqlite3_free(zOpen);
  return rc & 0xff;
}

/*
** Open a new database handle.
*/
int sqlite3_open(