1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Fix three crash problems discovered by afl-fuzz.

Ticket [a59ae93ee990a55].

FossilOrigin-Name: fe5788633131281a0f27c5b75993ce2ff958bfeb
This commit is contained in:
drh
2015-01-09 01:27:29 +00:00
parent fa5ed0283c
commit 655814d2bd
5 changed files with 38 additions and 15 deletions

View File

@@ -515,7 +515,7 @@ Expr *sqlite3PExpr(
const Token *pToken /* Argument token */
){
Expr *p;
if( op==TK_AND && pLeft && pRight ){
if( op==TK_AND && pLeft && pRight && pParse->nErr==0 ){
/* Take advantage of short-circuit false optimization for AND */
p = sqlite3ExprAnd(pParse->db, pLeft, pRight);
}else{
@@ -4069,10 +4069,11 @@ static int exprSrcCount(Walker *pWalker, Expr *pExpr){
int i;
struct SrcCount *p = pWalker->u.pSrcCount;
SrcList *pSrc = p->pSrc;
for(i=0; i<pSrc->nSrc; i++){
int nSrc = pSrc ? pSrc->nSrc : 0;
for(i=0; i<nSrc; i++){
if( pExpr->iTable==pSrc->a[i].iCursor ) break;
}
if( i<pSrc->nSrc ){
if( i<nSrc ){
p->nThis++;
}else{
p->nOther++;