/ Check-in [8d27e3e1]
Login

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

Overview
Comment:Fix a potential NULL pointer dereference following a syntax error.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8d27e3e16a9be79fe227e833f4770ebe09a9d90b
User & Date: drh 2015-03-22 10:23:17
Context
2015-03-23
19:03
Fix datetype size asserts in btree.c. check-in: ff4812d0 user: drh tags: trunk
17:25
Add the sqlite3_status64() interface. Make the new interface and the legacy sqlite3_status() both atomic and threadsafe. Check threadsafety using assert()s. check-in: 1ce8e8fa user: drh tags: status64
2015-03-22
10:23
Fix a potential NULL pointer dereference following a syntax error. check-in: 8d27e3e1 user: drh tags: trunk
2015-03-21
23:38
Fix harmless compiler warnings with MSVC when assert() and SQLITE_MEMDEBUG are both enabled. check-in: 9513dbd4 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

   393    393   ** the height is greater than the maximum allowed expression depth,
   394    394   ** leave an error in pParse.
   395    395   **
   396    396   ** Also propagate all EP_Propagate flags from the Expr.x.pList into
   397    397   ** Expr.flags. 
   398    398   */
   399    399   void sqlite3ExprSetHeightAndFlags(Parse *pParse, Expr *p){
          400  +  if( pParse->nErr ) return;
   400    401     exprSetHeight(p);
   401    402     sqlite3ExprCheckHeight(pParse, p->nHeight);
   402    403   }
   403    404   
   404    405   /*
   405    406   ** Return the maximum height of any expression tree referenced
   406    407   ** by the select statement passed as an argument.

Changes to test/misc1.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.
    12     12   #
    13     13   # This file implements tests for miscellanous features that were
    14     14   # left out of other test files.
    15     15   #
    16         -# $Id: misc1.test,v 1.42 2007/11/05 14:58:23 drh Exp $
    17     16   
    18     17   set testdir [file dirname $argv0]
    19     18   source $testdir/tester.tcl
    20     19   
    21     20   # Mimic the SQLite 2 collation type NUMERIC.
    22     21   db collate numeric numeric_collate
    23     22   proc numeric_collate {lhs rhs} {
................................................................................
   626    625   # presumably.
   627    626   #
   628    627   do_execsql_test misc1-20.1 {
   629    628     CREATE TABLE t0(x INTEGER DEFAULT(0==0) NOT NULL);
   630    629     REPLACE INTO t0(x) VALUES('');
   631    630     SELECT rowid, quote(x) FROM t0;
   632    631   } {1 ''}
          632  +
          633  +# 2015-03-22: NULL pointer dereference after a syntax error
          634  +#
          635  +do_catchsql_test misc1-21.1 {
          636  +  select''like''like''like#0;
          637  +} {1 {near "#0": syntax error}}
          638  +do_catchsql_test misc1-21.2 {
          639  +  VALUES(0,0x0MATCH#0;
          640  +} {1 {near ";": syntax error}}
   633    641   
   634    642   finish_test