SQLite

Check-in [3803e75038]
Login

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

Overview
Comment:Fix a potential 32-bit integer overflow in the "showdb" utility program when it is trying to interpret a corrupt database file.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3803e750384ec37091b0a6c350f8ef67720e316fd6f74c95e3c5f231c4a01ceb
User & Date: drh 2019-03-05 23:49:17.602
Context
2019-03-06
14:08
Add an "|| CORRUPT_DB" term to an assert() that might be false if the database is corrupt. Also add a branch to have sqlite3PagerMovepage() return SQLITE_CORRUPT in that case. (check-in: b0d5cf40bb user: drh tags: trunk)
2019-03-05
23:49
Fix a potential 32-bit integer overflow in the "showdb" utility program when it is trying to interpret a corrupt database file. (check-in: 3803e75038 user: drh tags: trunk)
16:53
Add a script to tool/ that will extract the sqlite3.h header file from an sqlite3.c amalgamation. (check-in: 38d2e510cd user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to tool/showdb.c.
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
  }
  if( nLocal<nPayload ){
    int ovfl = decodeInt32(a+nLocal);
    int cnt = 0;
    while( ovfl && (cnt++)<g.mxPage ){
      page_usage_msg(ovfl, "overflow %d from cell %d of page %d",
                     cnt, cellno, pgno);
      a = fileRead((ovfl-1)*g.pagesize, 4);
      ovfl = decodeInt32(a);
      sqlite3_free(a);
    }
  }
}









|







824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
  }
  if( nLocal<nPayload ){
    int ovfl = decodeInt32(a+nLocal);
    int cnt = 0;
    while( ovfl && (cnt++)<g.mxPage ){
      page_usage_msg(ovfl, "overflow %d from cell %d of page %d",
                     cnt, cellno, pgno);
      a = fileRead((ovfl-1)*(sqlite3_int64)g.pagesize, 4);
      ovfl = decodeInt32(a);
      sqlite3_free(a);
    }
  }
}