mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Avoid indexing off the front end of an array when creating a view with
two or more blank column names in the SELECT statement that defines the view. FossilOrigin-Name: 554501f158534f9c27fd51900589c2ab7cf300d8
This commit is contained in:
@@ -1522,7 +1522,7 @@ static int selectColumnsFromExprList(
|
||||
char *zNewName;
|
||||
int k;
|
||||
for(k=nName-1; k>1 && sqlite3Isdigit(zName[k]); k--){}
|
||||
if( zName[k]==':' ) nName = k;
|
||||
if( k>=0 && zName[k]==':' ) nName = k;
|
||||
zName[nName] = 0;
|
||||
zNewName = sqlite3MPrintf(db, "%s:%d", zName, ++cnt);
|
||||
sqlite3DbFree(db, zName);
|
||||
|
||||
Reference in New Issue
Block a user