/ Check-in [2c649cdf7e]
Login

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

Overview
Comment:Fix a bug caused by cherrypicking from a branch that assumes sqlite3_stricmp() can handle NULL arguments.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.8.6
Files: files | file ages | folders
SHA1: 2c649cdf7e058cf490597ffbddd5dc1eb5c3b346
User & Date: dan 2015-05-20 20:21:49
Context
2015-05-21
02:07
When parsing the schema, ignore any SQL that does not begin with "CREATE". Cherrypick of [d3c00d61581c] with additional changes. check-in: 09784f376b user: drh tags: branch-3.7.11
2015-05-20
20:24
Fix a potential NULL pointer deference on a corrupt database schema. Cherrypick of [dc61b292d8ea]. check-in: 7f3943fb01 user: dan tags: branch-3.8.6
20:21
Fix a bug caused by cherrypicking from a branch that assumes sqlite3_stricmp() can handle NULL arguments. check-in: 2c649cdf7e user: dan tags: branch-3.8.6
19:57
When parsing the schema, ignore any SQL that does not begin with "CREATE". Cherrypick of [d3c00d61581c]. check-in: 0da229b81a user: dan tags: branch-3.8.6
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/prepare.c.

    63     63       return 1;
    64     64     }
    65     65   
    66     66     assert( iDb>=0 && iDb<db->nDb );
    67     67     if( argv==0 ) return 0;   /* Might happen if EMPTY_RESULT_CALLBACKS are on */
    68     68     if( argv[1]==0 ){
    69     69       corruptSchema(pData, argv[0], 0);
    70         -  }else if( sqlite3_strnicmp(argv[2],"create ",7)==0 ){
           70  +  }else if( argv[2] && sqlite3_strnicmp(argv[2],"create ",7)==0 ){
    71     71       /* Call the parser to process a CREATE TABLE, INDEX or VIEW.
    72     72       ** But because db->init.busy is set to 1, no VDBE code is generated
    73     73       ** or executed.  All the parser does is build the internal data
    74     74       ** structures that describe the table, index, or view.
    75     75       */
    76     76       int rc;
    77     77       sqlite3_stmt *pStmt;