/ Check-in [0a2eb949]
Login

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

Overview
Comment:Fix a potential use-after-free bug that follows an OOM error in code added two days ago by check-in [84e02d773d60cffe]. Problem discovered by OSSFuzz.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0a2eb949f8a759e5745d9468c8183d3c0b4b30e0fa2a14b3062620eb9e1d5c1d
User & Date: drh 2019-11-01 16:37:53
Context
2019-11-01
17:31
The SET DEFAULT and SET NULL conflict resolution actions for foreign key constraints should cause an error when they appear on a generated column. check-in: b47513d2 user: drh tags: trunk
16:37
Fix a potential use-after-free bug that follows an OOM error in code added two days ago by check-in [84e02d773d60cffe]. Problem discovered by OSSFuzz. check-in: 0a2eb949 user: drh tags: trunk
16:08
Add another missing column number translation to the foreign key logic. check-in: 32df5edc user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

364
365
366
367
368
369
370

371
372
373
374
375
376
377
378
379
380
381
    return 0;
  }
  pCtx->pOut = 0;
  pCtx->pFunc = (FuncDef*)pFunc;
  pCtx->pVdbe = 0;
  pCtx->isError = 0;
  pCtx->argc = nArg;

  addr = sqlite3VdbeAddOp4(v, eCallCtx ? OP_PureFunc : OP_Function,
                           p1, p2, p3, (char*)pCtx, P4_FUNCCTX);
  sqlite3VdbeChangeP5(v, eCallCtx & NC_SelfRef);
  pCtx->iOp = addr;
  return addr;
}

/*
** Add an opcode that includes the p4 value with a P4_INT64 or
** P4_REAL type.
*/







>



<







364
365
366
367
368
369
370
371
372
373
374

375
376
377
378
379
380
381
    return 0;
  }
  pCtx->pOut = 0;
  pCtx->pFunc = (FuncDef*)pFunc;
  pCtx->pVdbe = 0;
  pCtx->isError = 0;
  pCtx->argc = nArg;
  pCtx->iOp = sqlite3VdbeCurrentAddr(v);
  addr = sqlite3VdbeAddOp4(v, eCallCtx ? OP_PureFunc : OP_Function,
                           p1, p2, p3, (char*)pCtx, P4_FUNCCTX);
  sqlite3VdbeChangeP5(v, eCallCtx & NC_SelfRef);

  return addr;
}

/*
** Add an opcode that includes the p4 value with a P4_INT64 or
** P4_REAL type.
*/