/ Check-in [bfe336a8]
Login

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

Overview
Comment:Fix a 1-byte buffer overwrite that can occur when a virtual table overloads an SQL function. (CVS 6833)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:bfe336a8993e06e70d3c32a929202fb015dcbb89
User & Date: danielk1977 2009-07-01 18:04:21
Context
2009-07-01
18:09
Change to test code and scripts allowing memsys3 to be tested using a build that has both memsys3 and memsys5 enabled. (CVS 6834) check-in: a00aeec2 user: danielk1977 tags: trunk
18:04
Fix a 1-byte buffer overwrite that can occur when a virtual table overloads an SQL function. (CVS 6833) check-in: bfe336a8 user: danielk1977 tags: trunk
16:12
Report an error if a USING or ON clause is specified following a from-list element that is not to the right of a join operator. Fix for #3846. (CVS 6832) check-in: 29b48972 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vtab.c.

     7      7   **    May you do good and not evil.
     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 code used to help implement virtual tables.
    13     13   **
    14         -** $Id: vtab.c,v 1.91 2009/06/15 16:27:08 shane Exp $
           14  +** $Id: vtab.c,v 1.92 2009/07/01 18:04:21 danielk1977 Exp $
    15     15   */
    16     16   #ifndef SQLITE_OMIT_VIRTUALTABLE
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** The actual function that does the work of creating a new module.
    21     21   ** This function implements the sqlite3_create_module() and
................................................................................
   821    821     if( rc==0 ){
   822    822       return pDef;
   823    823     }
   824    824   
   825    825     /* Create a new ephemeral function definition for the overloaded
   826    826     ** function */
   827    827     pNew = sqlite3DbMallocZero(db, sizeof(*pNew)
   828         -                             + sqlite3Strlen30(pDef->zName) );
          828  +                             + sqlite3Strlen30(pDef->zName) + 1);
   829    829     if( pNew==0 ){
   830    830       return pDef;
   831    831     }
   832    832     *pNew = *pDef;
   833    833     pNew->zName = (char *)&pNew[1];
   834    834     memcpy(pNew->zName, pDef->zName, sqlite3Strlen30(pDef->zName)+1);
   835    835     pNew->xFunc = xFunc;