/ Check-in [57db1406]
Login

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

Overview
Comment:Detect the failure to zero-terminate a result string due to a malloc failure. (CVS 4871)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 57db14067ff7d519291bebe695dcf991a9462372
User & Date: drh 2008-03-17 16:54:02
Context
2008-03-17
17:08
Abandon the OR optimization following a memory allocation failure, to avoid referencing uninitialized memory. (CVS 4872) check-in: 9d2afbb5 user: drh tags: trunk
16:54
Detect the failure to zero-terminate a result string due to a malloc failure. (CVS 4871) check-in: 57db1406 user: drh tags: trunk
16:23
Label test case bindxfer-1.9 as a misuse test case, since it is one. (CVS 4870) check-in: 7b991226 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

    39     39   **
    40     40   ** Various scripts scan this source file in order to generate HTML
    41     41   ** documentation, headers files, or other derived files.  The formatting
    42     42   ** of the code in this file is, therefore, important.  See other comments
    43     43   ** in this file for details.  If in doubt, do not deviate from existing
    44     44   ** commenting and indentation practices when changing or adding code.
    45     45   **
    46         -** $Id: vdbe.c,v 1.709 2008/02/13 18:25:27 danielk1977 Exp $
           46  +** $Id: vdbe.c,v 1.710 2008/03/17 16:54:02 drh Exp $
    47     47   */
    48     48   #include "sqliteInt.h"
    49     49   #include <ctype.h>
    50     50   #include "vdbeInt.h"
    51     51   
    52     52   /*
    53     53   ** The following global variable is incremented every time a cursor
................................................................................
   981    981     ** as side effect.
   982    982     */
   983    983     pMem = p->pResultSet = &p->aMem[pOp->p1];
   984    984     for(i=0; i<pOp->p2; i++){
   985    985       sqlite3VdbeMemNulTerminate(&pMem[i]);
   986    986       storeTypeInfo(&pMem[i], encoding);
   987    987     }
          988  +  if( db->mallocFailed ) goto no_mem;
   988    989   
   989    990     /* Return SQLITE_ROW
   990    991     */
   991    992     p->nCallback++;
   992    993     p->pc = pc + 1;
   993    994     rc = SQLITE_ROW;
   994    995     goto vdbe_return;