Browse Source

Check for >= 2 filenames when comparing backup archives on close

Fixes a vector out-of-bounds error
jobs
JamesJCode 1 year ago
parent
commit
84c0453ca9
  1. 3
      common/settings/settings_manager.cpp

3
common/settings/settings_manager.cpp

@ -1364,7 +1364,8 @@ bool SETTINGS_MANAGER::TriggerBackupIfNeeded( REPORTER& aReporter ) const
files.insert( files.begin(), target.GetFullPath() );
// Are there any changes since the last backup?
if( PROJECT_ARCHIVER::AreZipArchivesIdentical( files[0], files[1], aReporter ) )
if( files.size() >= 2
&& PROJECT_ARCHIVER::AreZipArchivesIdentical( files[0], files[1], aReporter ) )
{
wxRemoveFile( files[0] );
return true;

Loading…
Cancel
Save