/ Check-in [1a7e0b61]
Login

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

Overview
Comment:Add another test case for the problem fixed by the previous commit.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1a7e0b61c8a6bdd3ed105b9bc8a3732668fd7a897d2ed16c99445498e3c87089
User & Date: dan 2017-09-14 21:12:07
Context
2017-09-15
14:36
Fix a harmless comment typo. No changes to code. check-in: f7f0bf1d user: drh tags: trunk
2017-09-14
21:12
Add another test case for the problem fixed by the previous commit. check-in: 1a7e0b61 user: dan tags: trunk
20:41
Avoid an out-of-bounds read that can be caused by a specially constructed journal file. check-in: cf5bf42c user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  5948   5948           }
  5949   5949         }
  5950   5950         goto open_finished;
  5951   5951       }
  5952   5952     }
  5953   5953   #endif
  5954   5954     
  5955         -  assert( zPath==0 || zPath[0]=='/' || eType==SQLITE_OPEN_MASTER_JOURNAL );
         5955  +  assert( zPath==0 || zPath[0]=='/' 
         5956  +      || eType==SQLITE_OPEN_MASTER_JOURNAL || eType==SQLITE_OPEN_MAIN_JOURNAL 
         5957  +  );
  5956   5958     rc = fillInUnixFile(pVfs, fd, pFile, zPath, ctrlFlags);
  5957   5959   
  5958   5960   open_finished:
  5959   5961     if( rc!=SQLITE_OK ){
  5960   5962       sqlite3_free(p->pPreallocatedUnused);
  5961   5963     }
  5962   5964     return rc;

Changes to test/mjournal.test.

    53     53     hexio_write test0db2journal 0 abcd
    54     54   } {2}
    55     55   
    56     56   do_execsql_test 1.4 {
    57     57     SELECT * FROM t1;
    58     58   }
    59     59   
           60  +# And now test that nothing bad happens if a master journal contains a
           61  +# pointer to a journal file that does not have a "-" in the name. 
           62  +#
           63  +do_test 1.5 {
           64  +  forcedelete test.db2-master test.db-journal test1
           65  +  close [open test.db-journal w]
           66  +  hexio_write test.db-journal 0 746573742e6462322d6d617374657200
           67  +  hexio_write test.db-journal 16 00000010
           68  +  hexio_write test.db-journal 20 0000059f
           69  +  hexio_write test.db-journal 24 d9d505f920a163d7
           70  +
           71  +  close [open test.db2-master w]
           72  +  hexio_write test.db2-master 0 746573743100
           73  +
           74  +  close [open test1 w]
           75  +  hexio_write test1 0 abcd
           76  +} {2}
           77  +
           78  +do_execsql_test 1.6 {
           79  +  SELECT * FROM t1;
           80  +}
    60     81   
    61     82     
    62     83   finish_test