/ Check-in [dad2b74a]
Login

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

Overview
Comment:Fix a problem in test script corrupt.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dad2b74ad0a86ff07c77f0a60b26480fc0a2e54d
User & Date: dan 2009-09-10 18:04:02
Context
2009-09-10
18:17
Define SQLITE_TEST when compiling mem5.c for testfixture. check-in: 6b16f3c9 user: dan tags: trunk
18:04
Fix a problem in test script corrupt.test. check-in: dad2b74a user: dan tags: trunk
17:45
Add assert() statement to verify that new mutexes are not allocated when the mutex subsystem is uninitialized. check-in: 1183c533 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/corrupt.test.

   222    222   do_test corrupt-5.2 {
   223    223     db close
   224    224     hexio_write test.db 108 00000000 
   225    225     sqlite3 db test.db
   226    226     catchsql { SELECT * FROM sqlite_master }
   227    227   } {1 {database disk image is malformed}}
   228    228   
          229  +# At one point, the specific corruption caused by this test case was
          230  +# causing a buffer overwrite. Although a crash was never demonstrated,
          231  +# running this testcase under valgrind revealed the problem.
   229    232   do_test corrupt-6.1 {
   230    233     db close
   231    234     file delete -force test.db test.db-journal
   232    235     sqlite3 db test.db
   233    236     execsql { 
   234    237       PRAGMA page_size = 1024; CREATE TABLE t1(x);
   235    238     }
................................................................................
   248    251     db close
   249    252   
   250    253     set offset [expr ($rootpage * 1024)-14+2]
   251    254     hexio_write test.db $offset 00FF
   252    255     sqlite3 db test.db 
   253    256   
   254    257     catchsql { INSERT INTO t1 VALUES( randomblob(10) ) }
   255         -} {}
          258  +} {1 {database disk image is malformed}}
   256    259   
   257    260   finish_test