1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

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
This commit is contained in:
drh
2021-07-28 02:04:58 +00:00
parent 9045e7d696
commit c6da6dba69
3 changed files with 10 additions and 8 deletions

View File

@@ -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 ){