/ Check-in [8ca612c4]
Login

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

Overview
Comment:Check-in (6450) introduced the possibility of calling memset() with a negative 3rd argument. This fixes that bug. Ticket #3777. (CVS 6452)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:8ca612c42e0de3ef5b2f92d80a56db1bef34b1c6
User & Date: drh 2009-04-06 11:11:43
Context
2009-04-06
12:26
Make sure the reverse_unordered_selects pragma works even on unindexed tables that are queried without a WHERE clause (CVS 6453) check-in: d8c6b28a user: drh tags: trunk
11:11
Check-in (6450) introduced the possibility of calling memset() with a negative 3rd argument. This fixes that bug. Ticket #3777. (CVS 6452) check-in: 8ca612c4 user: drh tags: trunk
2009-04-05
15:18
Fix a segfault in Lemon that occurs if the input grammar does not define a type for tokens. This does not effect SQLite since the SQLite grammar does define a type for tokens. (CVS 6451) check-in: 4424aee9 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
....
1095
1096
1097
1098
1099
1100
1101

1102
1103
1104
1105
1106
1107
1108
**
*************************************************************************
** This file contains code used for creating, destroying, and populating
** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.)  Prior
** to version 2.8.7, all this code was combined into the vdbe.c source file.
** But that file was getting too big so this subroutines were split out.
**
** $Id: vdbeaux.c,v 1.447 2009/04/05 12:22:09 drh Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"



/*
................................................................................
    int nArg;       /* Maximum number of args passed to a user function. */
    resolveP2Values(p, &nArg);
    if( isExplain && nMem<10 ){
      nMem = 10;
    }
    zCsr += (zCsr - (u8*)0)&7;
    assert( EIGHT_BYTE_ALIGNMENT(zCsr) );


    do {
      memset(zCsr, 0, zEnd-zCsr);
      nByte = 0;
      allocSpace((char*)&p->aMem, nMem*sizeof(Mem), &zCsr, zEnd, &nByte);
      allocSpace((char*)&p->aVar, nVar*sizeof(Mem), &zCsr, zEnd, &nByte);
      allocSpace((char*)&p->apArg, nArg*sizeof(Mem*), &zCsr, zEnd, &nByte);







|







 







>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
....
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
**
*************************************************************************
** This file contains code used for creating, destroying, and populating
** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.)  Prior
** to version 2.8.7, all this code was combined into the vdbe.c source file.
** But that file was getting too big so this subroutines were split out.
**
** $Id: vdbeaux.c,v 1.448 2009/04/06 11:11:43 drh Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"



/*
................................................................................
    int nArg;       /* Maximum number of args passed to a user function. */
    resolveP2Values(p, &nArg);
    if( isExplain && nMem<10 ){
      nMem = 10;
    }
    zCsr += (zCsr - (u8*)0)&7;
    assert( EIGHT_BYTE_ALIGNMENT(zCsr) );
    if( zEnd<zCsr ) zEnd = zCsr;

    do {
      memset(zCsr, 0, zEnd-zCsr);
      nByte = 0;
      allocSpace((char*)&p->aMem, nMem*sizeof(Mem), &zCsr, zEnd, &nByte);
      allocSpace((char*)&p->aVar, nVar*sizeof(Mem), &zCsr, zEnd, &nByte);
      allocSpace((char*)&p->apArg, nArg*sizeof(Mem*), &zCsr, zEnd, &nByte);