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

Change a memcpy() in sqlite3FileSuffix() to memmove() on the grounds that the source and destination may overlap.

FossilOrigin-Name: 5e1d247e5b3b5dcf6763f01002e996786db48152
This commit is contained in:
dan
2011-11-04 12:05:52 +00:00
parent 689e38f7cf
commit d28286181d
3 changed files with 8 additions and 8 deletions

View File

@@ -1180,7 +1180,7 @@ void sqlite3FileSuffix3(const char *zBaseFilename, char *z){
int i, sz;
sz = sqlite3Strlen30(z);
for(i=sz-1; i>0 && z[i]!='/' && z[i]!='.'; i--){}
if( z[i]=='.' && ALWAYS(sz>i+4) ) memcpy(&z[i+1], &z[sz-3], 4);
if( z[i]=='.' && ALWAYS(sz>i+4) ) memmove(&z[i+1], &z[sz-3], 4);
}
}
#endif