diff options
author | drh <> | 2021-10-07 13:40:29 +0000 |
---|---|---|
committer | drh <> | 2021-10-07 13:40:29 +0000 |
commit | f9751074377d444231f7e9a05404a87051f10c8a (patch) | |
tree | 0bc16bb38d130a22c65fcd4f501f72eeef2ce790 /src/func.c | |
parent | 78b2fa8610bd2d149af7746faa79f095e505550c (diff) | |
download | sqlite-f9751074377d444231f7e9a05404a87051f10c8a.tar.gz sqlite-f9751074377d444231f7e9a05404a87051f10c8a.zip |
Protect all accesses to the FuncDef.u and Expr.u unions using nearby
assert()s or branches.
FossilOrigin-Name: 9af863f065e0bef491c2ab7525194505f9516f4e6dfc789d2e3a9d2c2438533a
Diffstat (limited to 'src/func.c')
-rw-r--r-- | src/func.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/func.c b/src/func.c index 754ffc50e..3e1bd86c4 100644 --- a/src/func.c +++ b/src/func.c @@ -1940,6 +1940,7 @@ int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){ } assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); nExpr = pExpr->x.pList->nExpr; + assert( !ExprHasProperty(pExpr, EP_IntValue) ); pDef = sqlite3FindFunction(db, pExpr->u.zToken, nExpr, SQLITE_UTF8, 0); #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION if( pDef==0 ) return 0; @@ -1963,6 +1964,7 @@ int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){ Expr *pEscape = pExpr->x.pList->a[2].pExpr; char *zEscape; if( pEscape->op!=TK_STRING ) return 0; + assert( !ExprHasProperty(pEscape, EP_IntValue) ); zEscape = pEscape->u.zToken; if( zEscape[0]==0 || zEscape[1]!=0 ) return 0; if( zEscape[0]==aWc[0] ) return 0; @@ -2344,6 +2346,7 @@ void sqlite3RegisterBuiltinFunctions(void){ for(p=sqlite3BuiltinFunctions.a[i]; p; p=p->u.pHash){ int n = sqlite3Strlen30(p->zName); int h = p->zName[0] + n; + assert( p->funcFlags & SQLITE_FUNC_BUILTIN ); printf(" %s(%d)", p->zName, h); } printf("\n"); |