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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user