1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Fix a problem with the filename normalizer in unix, discovered by dbsqlfuzz.

FossilOrigin-Name: ff1eca7fcdcbc550a5f23db9d85281e5373500912699a7c7ae54bc0df0547e26
This commit is contained in:
drh
2021-03-18 13:55:25 +00:00
parent e44ac3858c
commit 8e7c82ca3f
3 changed files with 9 additions and 8 deletions

View File

@@ -6361,7 +6361,8 @@ static int unixBackupDir(const char *z, int *pJ){
int j = *pJ;
int i;
if( j<=0 ) return 0;
for(i=j-1; ALWAYS(i>0) && z[i-1]!='/'; i--){}
for(i=j-1; i>0 && z[i-1]!='/'; i--){}
if( i==0 ) return 0;
if( z[i]=='.' && i==j-2 && z[i+1]=='.' ) return 0;
*pJ = i-1;
return 1;