/ Check-in [2b28e8d5]
Login

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

Overview
Comment:Add a test case to verify that the previous change avoids excess buffer overread in sqlite3VdbeRecordCompare().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2b28e8d582cf10936fa1faca04a16ca2eeead66f
User & Date: drh 2014-03-26 15:05:56
Context
2014-03-26
16:22
Fix a potential buffer overread that could have occurred when searching a corrupt database file. check-in: db293547 user: drh tags: branch-3.8.4
15:14
Add an extra test case for the potential buffer overread patched by [28ddecff04]. check-in: f585f5d7 user: dan tags: trunk
15:05
Add a test case to verify that the previous change avoids excess buffer overread in sqlite3VdbeRecordCompare(). check-in: 2b28e8d5 user: drh tags: trunk
14:51
Earlier detection of corruption in sqlite3VdbeRecordCompare() in order to avoid a potential buffer overread. check-in: 28ddecff user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/corruptI.test.

    28     28   # Initialize the database.
    29     29   #
    30     30   do_execsql_test 1.1 {
    31     31     PRAGMA page_size=1024;
    32     32     PRAGMA auto_vacuum=0;
    33     33     CREATE TABLE t1(a);
    34     34     CREATE INDEX i1 ON t1(a);
    35         -  INSERT INTO t1 VALUES('a');
           35  +  INSERT INTO t1 VALUES('abcdefghijklmnop');
    36     36   } {}
    37     37   db close
    38     38   
    39     39   do_test 1.2 {
    40     40     set offset [hexio_get_int [hexio_read test.db [expr 2*1024 + 8] 2]]
    41     41     set off [expr 2*1024 + $offset + 1]
    42         -  hexio_write test.db $off FF06
           42  +  hexio_write test.db $off 7f06
           43  +  sqlite3 db test.db
           44  +  catchsql { SELECT * FROM t1 WHERE a = 10 }
           45  +} {0 {}}
           46  +
           47  +do_test 1.3 {
           48  +  db close
           49  +  set offset [hexio_get_int [hexio_read test.db [expr 2*1024 + 8] 2]]
           50  +  set off [expr 2*1024 + $offset + 1]
           51  +  hexio_write test.db $off FFFF7f02
    43     52     sqlite3 db test.db
    44     53     catchsql { SELECT * FROM t1 WHERE a = 10 }
    45     54   } {0 {}}
    46     55   
    47     56   
    48     57   finish_test