Fix a segfault that could follow an OOM when querying a table that has one or more columns with default values "true" or "false".

FossilOrigin-Name: 202f9919c222ee933924c63c15ad36ec4481457b1e4d9179af14c9f284117c0c
This commit is contained in:
dan
2019-01-25 17:26:59 +00:00
parent e88609f23e
commit c2ea77e5b2
4 changed files with 49 additions and 10 deletions
+5 -3
View File
@@ -1530,9 +1530,11 @@ static int valueFromExpr(
}
#endif
else if( op==TK_TRUEFALSE ){
pVal = valueNew(db, pCtx);
pVal->flags = MEM_Int;
pVal->u.i = pExpr->u.zToken[4]==0;
pVal = valueNew(db, pCtx);
if( pVal ){
pVal->flags = MEM_Int;
pVal->u.i = pExpr->u.zToken[4]==0;
}
}
*ppVal = pVal;