1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Avoid another potential OOB read in sqlite3expert.c.

FossilOrigin-Name: 0ccea80092f16e7f17f4c4de4f8be3fdef217199fcc08ace37e179c1b22c1294
This commit is contained in:
dan
2020-05-21 19:13:46 +00:00
parent 4f1315a432
commit 23e3c340b5
3 changed files with 12 additions and 10 deletions

View File

@ -1136,9 +1136,11 @@ int idxFindIndexes(
for(i=0; i<nDetail; i++){
const char *zIdx = 0;
if( memcmp(&zDetail[i], " USING INDEX ", 13)==0 ){
if( i+13<nDetail && memcmp(&zDetail[i], " USING INDEX ", 13)==0 ){
zIdx = &zDetail[i+13];
}else if( memcmp(&zDetail[i], " USING COVERING INDEX ", 22)==0 ){
}else if( i+22<nDetail
&& memcmp(&zDetail[i], " USING COVERING INDEX ", 22)==0
){
zIdx = &zDetail[i+22];
}
if( zIdx ){