/ Check-in [9453e7da]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix a crash that can occur following an OOM condition within a CREATE VIRTUAL TABLE statement on a utf-16 database.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | malformed-vtab-name
Files: files | file ages | folders
SHA1: 9453e7da046c55715631f10f018e97a336197969
User & Date: dan 2015-03-19 19:59:30
Context
2015-03-19
20:09
If a virtual table is created with a malformed UTF8 name in a UTF16 database, make sure that does not cause problems. check-in: b74cb0a9 user: drh tags: trunk
19:59
Fix a crash that can occur following an OOM condition within a CREATE VIRTUAL TABLE statement on a utf-16 database. Closed-Leaf check-in: 9453e7da user: dan tags: malformed-vtab-name
18:56
Fix a problem with creating virtual table with names specified using malformed utf-8 within utf-16 databases. check-in: 9969cff2 user: dan tags: malformed-vtab-name
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

6017
6018
6019
6020
6021
6022
6023


6024

6025
6026
6027
6028
6029
6030
6031
case OP_VCreate: {
  Mem sMem;          /* For storing the record being decoded */
  memset(&sMem, 0, sizeof(sMem));
  sMem.db = db;
  rc = sqlite3VdbeMemCopy(&sMem, &aMem[pOp->p2]);
  if( rc==SQLITE_OK ){
    const char *zTab = (const char*)sqlite3_value_text(&sMem);


    rc = sqlite3VtabCallCreate(db, pOp->p1, zTab, &p->zErrMsg);

  }
  sqlite3VdbeMemRelease(&sMem);
  break;
}
#endif /* SQLITE_OMIT_VIRTUALTABLE */

#ifndef SQLITE_OMIT_VIRTUALTABLE







>
>
|
>







6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
case OP_VCreate: {
  Mem sMem;          /* For storing the record being decoded */
  memset(&sMem, 0, sizeof(sMem));
  sMem.db = db;
  rc = sqlite3VdbeMemCopy(&sMem, &aMem[pOp->p2]);
  if( rc==SQLITE_OK ){
    const char *zTab = (const char*)sqlite3_value_text(&sMem);
    assert( zTab || db->mallocFailed );
    if( zTab ){
      rc = sqlite3VtabCallCreate(db, pOp->p1, zTab, &p->zErrMsg);
    }
  }
  sqlite3VdbeMemRelease(&sMem);
  break;
}
#endif /* SQLITE_OMIT_VIRTUALTABLE */

#ifndef SQLITE_OMIT_VIRTUALTABLE