SQLite

Check-in [20a8c61122]
Login

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

Overview
Comment:Make sure the open_db() routine in the CLI does not invoke access() with a NULL filename.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 20a8c61122f37a43c418ca4415b3d26e0f7a27a6faea9048aa9fbb1a56e9d629
User & Date: drh 2018-05-11 15:10:11.641
Context
2018-05-11
15:10
Fix a typo in the help message from the ".sha3sum" command in the CLI. (check-in: dba87a2018 user: drh tags: trunk)
15:10
Make sure the open_db() routine in the CLI does not invoke access() with a NULL filename. (check-in: 20a8c61122 user: drh tags: trunk)
14:00
Make sure the open_db() routine in the CLI does not invoke access() with a NULL filename. (check-in: 2b8fd3b497 user: drh tags: geojson)
2018-05-09
16:32
Add a test case to check that the fts5 unicode64 tokenizer is dealing with codepoints greater than 65535 correctly. (check-in: 9f7a6ae878 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/shell.c.in.
3569
3570
3571
3572
3573
3574
3575
3576



3577

3578
3579
3580
3581
3582
3583
3584

/*
** Make sure the database is open.  If it is not, then open it.  If
** the database fails to open, print an error message and exit.
*/
static void open_db(ShellState *p, int keepAlive){
  if( p->db==0 ){
    if( p->openMode==SHELL_OPEN_UNSPEC && access(p->zDbFilename,0)==0 ){



      p->openMode = (u8)deduceDatabaseType(p->zDbFilename, 0);

    }
    switch( p->openMode ){
      case SHELL_OPEN_APPENDVFS: {
        sqlite3_open_v2(p->zDbFilename, &p->db, 
           SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "apndvfs");
        break;
      }







|
>
>
>
|
>







3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588

/*
** Make sure the database is open.  If it is not, then open it.  If
** the database fails to open, print an error message and exit.
*/
static void open_db(ShellState *p, int keepAlive){
  if( p->db==0 ){
    if( p->openMode==SHELL_OPEN_UNSPEC ){
      if( p->zDbFilename==0 || p->zDbFilename[0]==0 ){
        p->openMode = SHELL_OPEN_NORMAL;
      }else if( access(p->zDbFilename,0)==0 ){
        p->openMode = (u8)deduceDatabaseType(p->zDbFilename, 0);
      }
    }
    switch( p->openMode ){
      case SHELL_OPEN_APPENDVFS: {
        sqlite3_open_v2(p->zDbFilename, &p->db, 
           SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, "apndvfs");
        break;
      }