/ 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 Unified Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
...
981
982
983
984
985
986
987

988
989
990
991
992
993
994
**
** Various scripts scan this source file in order to generate HTML
** documentation, headers files, or other derived files.  The formatting
** of the code in this file is, therefore, important.  See other comments
** in this file for details.  If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
** $Id: vdbe.c,v 1.709 2008/02/13 18:25:27 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
#include "vdbeInt.h"

/*
** The following global variable is incremented every time a cursor
................................................................................
  ** as side effect.
  */
  pMem = p->pResultSet = &p->aMem[pOp->p1];
  for(i=0; i<pOp->p2; i++){
    sqlite3VdbeMemNulTerminate(&pMem[i]);
    storeTypeInfo(&pMem[i], encoding);
  }


  /* Return SQLITE_ROW
  */
  p->nCallback++;
  p->pc = pc + 1;
  rc = SQLITE_ROW;
  goto vdbe_return;







|







 







>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
...
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
**
** Various scripts scan this source file in order to generate HTML
** documentation, headers files, or other derived files.  The formatting
** of the code in this file is, therefore, important.  See other comments
** in this file for details.  If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
** $Id: vdbe.c,v 1.710 2008/03/17 16:54:02 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
#include "vdbeInt.h"

/*
** The following global variable is incremented every time a cursor
................................................................................
  ** as side effect.
  */
  pMem = p->pResultSet = &p->aMem[pOp->p1];
  for(i=0; i<pOp->p2; i++){
    sqlite3VdbeMemNulTerminate(&pMem[i]);
    storeTypeInfo(&pMem[i], encoding);
  }
  if( db->mallocFailed ) goto no_mem;

  /* Return SQLITE_ROW
  */
  p->nCallback++;
  p->pc = pc + 1;
  rc = SQLITE_ROW;
  goto vdbe_return;