/ Check-in [b94a3a37]
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 | SQL 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
Context
2016-01-20
15:08
Fix the build so that it works for SQLITE_OMIT_WAL again. check-in: d1c15de5 user: drh tags: branch-3.10
15:05
Fix a potential use-after-free problem when compiling with SQLITE_HAS_CODEC. check-in: b94a3a37 user: drh tags: branch-3.10
14:32
Increase version number to 3.10.2. check-in: c1f918dc 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: 653ea15a user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
....
3003
3004
3005
3006
3007
3008
3009

3010
3011
3012
3013
3014
3015
3016
  /* 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 );
................................................................................
        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(







<







 







>







2966
2967
2968
2969
2970
2971
2972

2973
2974
2975
2976
2977
2978
2979
....
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
  /* 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 );
................................................................................
        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(