/ Check-in [3b461425]
Login

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

Overview
Comment:Fix a NULL pointer dereference following an OOM error in the column name resolver. (CVS 6685)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3b46142532934d17aa136c2e56e58e7828df0f54
User & Date: drh 2009-05-28 14:34:50
Context
2009-05-28
21:04
Remove references to deleted function sqlite3ExprRegister(). Changes to the expr.c source module to promote better testing. (CVS 6686) check-in: 6ae4ad6e user: drh tags: trunk
14:34
Fix a NULL pointer dereference following an OOM error in the column name resolver. (CVS 6685) check-in: 3b461425 user: drh tags: trunk
12:49
Make sure the column name resolver does not try to duplicate Expr.u.zToken when the Expr.u.iValue union member is the element being used. (CVS 6684) check-in: 376ecf0d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/resolve.c.

    10     10   **
    11     11   *************************************************************************
    12     12   **
    13     13   ** This file contains routines used for walking the parser tree and
    14     14   ** resolve all identifiers by associating them with a particular
    15     15   ** table and column.
    16     16   **
    17         -** $Id: resolve.c,v 1.25 2009/05/28 12:49:53 drh Exp $
           17  +** $Id: resolve.c,v 1.26 2009/05/28 14:34:50 drh Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include <stdlib.h>
    21     21   #include <string.h>
    22     22   
    23     23   /*
    24     24   ** Turn the pExpr expression into an alias for the iCol-th column of the
................................................................................
    69     69       if( pDup==0 ) return;
    70     70       if( pEList->a[iCol].iAlias==0 ){
    71     71         pEList->a[iCol].iAlias = (u16)(++pParse->nAlias);
    72     72       }
    73     73       pDup->iTable = pEList->a[iCol].iAlias;
    74     74     }else if( ExprHasProperty(pOrig, EP_IntValue) || pOrig->u.zToken==0 ){
    75     75       pDup = sqlite3ExprDup(db, pOrig, 0);
           76  +    if( pDup==0 ) return;
    76     77     }else{
    77     78       char *zToken = pOrig->u.zToken;
    78     79       pOrig->u.zToken = 0;
    79     80       pDup = sqlite3ExprDup(db, pOrig, 0);
    80     81       pOrig->u.zToken = zToken;
    81     82       if( pDup==0 ) return;
    82     83       if( zToken ){