aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2021-09-07 15:41:25 +0000
committerdrh <>2021-09-07 15:41:25 +0000
commiteb61630b400f436b2fc6a54438ba2846e29b843c (patch)
tree5eafba981f02a27653aa17a5c33c222d47067f30 /src
parentfb8ca7de0cf8d6acf8899922cfd63b25e72594e8 (diff)
downloadsqlite-eb61630b400f436b2fc6a54438ba2846e29b843c.tar.gz
sqlite-eb61630b400f436b2fc6a54438ba2846e29b843c.zip
Fix a potential NULL pointer deference in the LIKE optimization. The
problem was introduced by the addition of generated columns in check-in [b855acf1831943b3] (SQLite version 3.31.0, 2020-01-22). Reported by Wang Ke in [forum/forumpost/699b44b3ee|forum post 699b44b3ee]. FossilOrigin-Name: b9417d400f4585004f434837022709f818044d5844fe208fe01595a6b226ef7d
Diffstat (limited to 'src')
-rw-r--r--src/whereexpr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/whereexpr.c b/src/whereexpr.c
index 3492769db..9b5d2cce9 100644
--- a/src/whereexpr.c
+++ b/src/whereexpr.c
@@ -263,7 +263,7 @@ static int isLikeOrGlob(
*/
if( pLeft->op!=TK_COLUMN
|| sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT
- || IsVirtual(pLeft->y.pTab) /* Value might be numeric */
+ || (pLeft->y.pTab && IsVirtual(pLeft->y.pTab)) /* Might be numeric */
){
int isNum;
double rDummy;