mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Catch and avoid a 16-bit integer overflow on the number of columns in a
common table expression. This fixes a problem found by OSS-Fuzz. The test case is in TH3. FossilOrigin-Name: 6ee8cb6ae5fd076ec226bb184b5690ba29f9df8cfaef47aaf13336873b4c1f6c
This commit is contained in:
@@ -1689,6 +1689,7 @@ int sqlite3ColumnsFromExprList(
|
||||
nCol = pEList->nExpr;
|
||||
aCol = sqlite3DbMallocZero(db, sizeof(aCol[0])*nCol);
|
||||
testcase( aCol==0 );
|
||||
if( nCol>32767 ) nCol = 32767;
|
||||
}else{
|
||||
nCol = 0;
|
||||
aCol = 0;
|
||||
|
||||
Reference in New Issue
Block a user