Skip to content

Commit

Permalink
Fix incorrect argument to _mktemp_s
Browse files Browse the repository at this point in the history
  • Loading branch information
qris committed Apr 25, 2017
1 parent 030f54d commit db56ad3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/backupstore/BackupStoreCheck.cpp
Expand Up @@ -139,12 +139,11 @@ void BackupStoreCheck::Check()
}
else
{
std::string temp_file = GetTempDirPath() + DIRECTORY_SEPARATOR +
"boxbackup_refcount_db_XXXXXX";
std::string temp_file = GetTempDirPath() + "boxbackup_refcount_db_XXXXXX";
char temp_file_buf[PATH_MAX];
strncpy(temp_file_buf, temp_file.c_str(), sizeof(temp_file_buf));
#ifdef WIN32
if(_mktemp_s(temp_file_buf, temp_file.size()) != 0)
if(_mktemp_s(temp_file_buf, sizeof(temp_file_buf)) != 0)
{
THROW_EXCEPTION_MESSAGE(BackupStoreException, FailedToCreateTemporaryFile,
"Failed to get a temporary file name based on " << temp_file);
Expand Down

0 comments on commit db56ad3

Please sign in to comment.