/ Check-in [4bb256ee]
Login

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

Overview
Comment:A failed malloc() could have resulted in a segfault. Fixed by this check-in. (CVS 1102)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4bb256ee3ecd44d71d90556e16bb56c0389fd5b5
User & Date: drh 2003-09-23 10:25:33
Context
2003-09-27
00:41
Do all WHERE clauses tests, even if an index is used for lookup so that we know the test cannot be FALSE. The test might end up being NULL in which case it would need to be treated as false. Ticket #461. (CVS 1103) check-in: 5aea8148 user: drh tags: trunk
2003-09-23
10:25
A failed malloc() could have resulted in a segfault. Fixed by this check-in. (CVS 1102) check-in: 4bb256ee user: drh tags: trunk
00:36
allow -enable-releasemode as an option and allow Makefile to produce version independent binary like libsqlite-2.8.6.so instead of libsqlite.so.0.0.0 (CVS 1101) check-in: 4fdd44a5 user: xdong tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains routines used for analyzing expressions and
    13     13   ** for generating VDBE code that evaluates expressions in SQLite.
    14     14   **
    15         -** $Id: expr.c,v 1.100 2003/09/06 22:18:08 drh Exp $
           15  +** $Id: expr.c,v 1.101 2003/09/23 10:25:33 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <ctype.h>
    19     19   
    20     20   /*
    21     21   ** Construct a new expression node and return a pointer to it.  Memory
    22     22   ** for this node is obtained from sqliteMalloc().  The calling function
................................................................................
   261    261       a = sqliteRealloc(pList->a, pList->nAlloc*sizeof(pList->a[0]));
   262    262       if( a==0 ){
   263    263         sqliteExprDelete(pExpr);
   264    264         return pList;
   265    265       }
   266    266       pList->a = a;
   267    267     }
   268         -  if( pExpr || pName ){
          268  +  if( pList->a && (pExpr || pName) ){
   269    269       i = pList->nExpr++;
   270    270       pList->a[i].pExpr = pExpr;
   271    271       pList->a[i].zName = 0;
   272    272       if( pName ){
   273    273         sqliteSetNString(&pList->a[i].zName, pName->z, pName->n, 0);
   274    274         sqliteDequote(pList->a[i].zName);
   275    275       }