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

Add more code to enforce the limits specified in limits.h. (CVS 3946)

FossilOrigin-Name: c59d436095b5258d7132a432c0cb6cd5a7990d85
This commit is contained in:
drh
2007-05-08 13:58:26 +00:00
parent 4b5710e486
commit e5c941b83b
8 changed files with 51 additions and 25 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
** $Id: select.c,v 1.341 2007/05/06 20:04:25 drh Exp $
** $Id: select.c,v 1.342 2007/05/08 13:58:28 drh Exp $
*/
#include "sqliteInt.h"
@@ -1359,6 +1359,10 @@ static int prepSelectStmt(Parse *pParse, Select *p){
sqlite3ExprListDelete(pEList);
p->pEList = pNew;
}
if( p->pEList && p->pEList->nExpr>SQLITE_MAX_COLUMN ){
sqlite3ErrorMsg(pParse, "too many columns in result set");
rc = SQLITE_ERROR;
}
return rc;
}
@@ -2500,6 +2504,10 @@ static int processOrderGroupBy(
assert( pEList );
if( pOrderBy==0 ) return 0;
if( pOrderBy->nExpr>SQLITE_MAX_COLUMN ){
sqlite3ErrorMsg(pParse, "too many terms in %s BY clause", zType);
return 1;
}
for(i=0; i<pOrderBy->nExpr; i++){
int iCol;
Expr *pE = pOrderBy->a[i].pExpr;