aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-03-04 21:19:51 +0000
committerdrh <drh@noemail.net>2014-03-04 21:19:51 +0000
commit19c6d96aec7545d5c8723c48bde5089a8f89a5c7 (patch)
treed75cf6bf0390e6969646145a8db2b1c2d7c66e97 /src
parent052c6784eed4dd88116872182c9ff8ec962f1bfa (diff)
downloadsqlite-19c6d96aec7545d5c8723c48bde5089a8f89a5c7.tar.gz
sqlite-19c6d96aec7545d5c8723c48bde5089a8f89a5c7.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/select.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c
index 9430888c4..850bc6a90 100644
--- a/src/select.c
+++ b/src/select.c
@@ -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);