/ Check-in [2c1ef40e]
Login

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

Overview
Comment:Fix the xFetch method of the "memdb" VFS (used by deserialize) so that it is robust against corrupt database file.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dbsqlfuzz-in-fuzzcheck
Files: files | file ages | folders
SHA3-256:2c1ef40e787a6bc355b50168527a47eb09acd30d0d88cff8336a434ad554115d
User & Date: drh 2019-01-25 14:16:01
Context
2019-01-25
14:23
Extend fuzzcheck so that it can process dbsqlfuzz cases. Add a collection of interesting dbsqlfuzz cases to the standard test suite. check-in: e2991a7e user: drh tags: trunk
14:16
Fix the xFetch method of the "memdb" VFS (used by deserialize) so that it is robust against corrupt database file. Closed-Leaf check-in: 2c1ef40e user: drh tags: dbsqlfuzz-in-fuzzcheck
13:03
In fuzzcheck, activate vdbe_debug for dbsqlfuzz cases when using the -vvvvv verbosity level or above. check-in: 2e6f7c2a user: drh tags: dbsqlfuzz-in-fuzzcheck
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to src/memdb.c.

306
307
308
309
310
311
312




313
314

315
316
317
318
319
320
321
static int memdbFetch(
  sqlite3_file *pFile,
  sqlite3_int64 iOfst,
  int iAmt,
  void **pp
){
  MemFile *p = (MemFile *)pFile;




  p->nMmap++;
  *pp = (void*)(p->aData + iOfst);

  return SQLITE_OK;
}

/* Release a memory-mapped page */
static int memdbUnfetch(sqlite3_file *pFile, sqlite3_int64 iOfst, void *pPage){
  MemFile *p = (MemFile *)pFile;
  p->nMmap--;







>
>
>
>
|
|
>







306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
static int memdbFetch(
  sqlite3_file *pFile,
  sqlite3_int64 iOfst,
  int iAmt,
  void **pp
){
  MemFile *p = (MemFile *)pFile;
  if( iOfst+iAmt>p->sz ){
    assert( CORRUPT_DB );
    *pp = 0;
  }else{
    p->nMmap++;
    *pp = (void*)(p->aData + iOfst);
  }
  return SQLITE_OK;
}

/* Release a memory-mapped page */
static int memdbUnfetch(sqlite3_file *pFile, sqlite3_int64 iOfst, void *pPage){
  MemFile *p = (MemFile *)pFile;
  p->nMmap--;