mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
When an error occurs while rewriting the parser tree for window functions
in the sqlite3WindowRewrite() routine, make sure that pParse->nErr is set, and make sure that this shuts down any subsequent code generation that might depend on the transformations that were implemented. This fixes a problem discovered by the Yongheng and Rui fuzzer. FossilOrigin-Name: e2bddcd4c55ba3cbe0130332679ff4b048630d0ced9a8899982edb5a3569ba7f
This commit is contained in:
@@ -934,7 +934,7 @@ int sqlite3WindowRewrite(Parse *pParse, Select *p){
|
||||
|
||||
pTab = sqlite3DbMallocZero(db, sizeof(Table));
|
||||
if( pTab==0 ){
|
||||
return SQLITE_NOMEM;
|
||||
return sqlite3ErrorToParser(db, SQLITE_NOMEM);
|
||||
}
|
||||
|
||||
p->pSrc = 0;
|
||||
@@ -1039,6 +1039,10 @@ int sqlite3WindowRewrite(Parse *pParse, Select *p){
|
||||
sqlite3DbFree(db, pTab);
|
||||
}
|
||||
|
||||
if( rc && pParse->nErr==0 ){
|
||||
assert( pParse->db->mallocFailed );
|
||||
return sqlite3ErrorToParser(pParse->db, SQLITE_NOMEM);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user