diff options
author | drh <> | 2021-07-28 02:04:58 +0000 |
---|---|---|
committer | drh <> | 2021-07-28 02:04:58 +0000 |
commit | c6da6dba691736f2eb156b419d63eb42b5a55cfa (patch) | |
tree | b7805d53db7852844fd13c25a3055ed60fecf54b /src | |
parent | 9045e7d69680dba14ea6ac9d93fbb421abc568e0 (diff) | |
download | sqlite-c6da6dba691736f2eb156b419d63eb42b5a55cfa.tar.gz sqlite-c6da6dba691736f2eb156b419d63eb42b5a55cfa.zip |
Fix a harmless uninitialized variable read that occurs after an error
associated with a subquery that uses DISTINCT. Found by a fuzzer.
FossilOrigin-Name: e9719f975f61c4c9f40ea077b049eed97d0957b925a4b6149d9ee21ce827b6a1
Diffstat (limited to 'src')
-rw-r--r-- | src/select.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c index a50595413..66e1434a3 100644 --- a/src/select.c +++ b/src/select.c @@ -873,7 +873,9 @@ static void fixDistinctOpenEph( int iVal, /* Value returned by codeDistinct() */ int iOpenEphAddr /* Address of OP_OpenEphemeral instruction for iTab */ ){ - if( eTnctType==WHERE_DISTINCT_UNIQUE || eTnctType==WHERE_DISTINCT_ORDERED ){ + if( pParse->nErr==0 + && (eTnctType==WHERE_DISTINCT_UNIQUE || eTnctType==WHERE_DISTINCT_ORDERED) + ){ Vdbe *v = pParse->pVdbe; sqlite3VdbeChangeToNoop(v, iOpenEphAddr); if( sqlite3VdbeGetOp(v, iOpenEphAddr+1)->opcode==OP_Explain ){ |