/ Check-in [de078148]
Login

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

Overview
Comment:Fix a crash that can follow an OOM in fts3 on this branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.19
Files: files | file ages | folders
SHA3-256: de0781485701c138be58dcb0bb8eaa9dd2bad828ccafcc40db906f606d967639
User & Date: dan 2018-12-19 14:44:20
Context
2018-12-19
17:05
Add new interfaces sqlite3_result_pointer(), and sqlite3_value_pointer() and use them to transfer the eponymous FTS3 column pointer to the snippet() and offsets() routines. Cherrypick from commit [8201f4e1] on branch-3.18. Leaf check-in: 553a923c user: dan tags: branch-3.19
14:44
Fix a crash that can follow an OOM in fts3 on this branch. check-in: de078148 user: dan tags: branch-3.19
01:44
Add extra defenses against strategically corrupt databases to fts3/4. check-in: 4f315e4a user: drh tags: branch-3.19
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3.c.

3559
3560
3561
3562
3563
3564
3565
3566


3567
3568
3569
3570
3571
3572
3573
static int fts3FunctionArg(
  sqlite3_context *pContext,      /* SQL function call context */
  const char *zFunc,              /* Function name */
  sqlite3_value *pVal,            /* argv[0] passed to function */
  Fts3Cursor **ppCsr              /* OUT: Store cursor handle here */
){
  int rc = SQLITE_OK;
  if( sqlite3_value_subtype(pVal)==SQLITE_BLOB ){


    *ppCsr = *(Fts3Cursor**)sqlite3_value_blob(pVal);
  }else{
    char *zErr = sqlite3_mprintf("illegal first argument to %s", zFunc);
    sqlite3_result_error(pContext, zErr, -1);
    sqlite3_free(zErr);
    rc = SQLITE_ERROR;
  }







|
>
>







3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
static int fts3FunctionArg(
  sqlite3_context *pContext,      /* SQL function call context */
  const char *zFunc,              /* Function name */
  sqlite3_value *pVal,            /* argv[0] passed to function */
  Fts3Cursor **ppCsr              /* OUT: Store cursor handle here */
){
  int rc = SQLITE_OK;
  if( sqlite3_value_subtype(pVal)==SQLITE_BLOB 
   && sqlite3_value_bytes(pVal)==sizeof(Fts3Cursor*) 
  ){
    *ppCsr = *(Fts3Cursor**)sqlite3_value_blob(pVal);
  }else{
    char *zErr = sqlite3_mprintf("illegal first argument to %s", zFunc);
    sqlite3_result_error(pContext, zErr, -1);
    sqlite3_free(zErr);
    rc = SQLITE_ERROR;
  }