diff --git a/Source/Core/DiscIO/Src/Filesystem.h b/Source/Core/DiscIO/Src/Filesystem.h index 2fa44ecb81..c50e8f8f0a 100644 --- a/Source/Core/DiscIO/Src/Filesystem.h +++ b/Source/Core/DiscIO/Src/Filesystem.h @@ -39,7 +39,7 @@ struct SFileInfo SFileInfo(const SFileInfo &rhs) : m_NameOffset(rhs.m_NameOffset), m_Offset(rhs.m_Offset), m_FileSize(rhs.m_FileSize) { - memcpy(m_FullPath, rhs.m_FullPath, strlen(rhs.m_FullPath)); + memcpy(m_FullPath, rhs.m_FullPath, strlen(rhs.m_FullPath) + 1); } }; diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index 1cbe922b5e..f87e856268 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -676,7 +676,7 @@ void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolde if (fst[i]->IsDirectory()) { - sprintf(exportName, "%s/%s/", _rExportFolder, fst[i]->m_FullPath); + snprintf(exportName, sizeof(exportName), "%s/%s/", _rExportFolder, fst[i]->m_FullPath); DEBUG_LOG(DISCIO, "%s", exportName); if (!File::Exists(exportName) && !File::CreateFullPath(exportName)) @@ -693,7 +693,7 @@ void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolde } else { - sprintf(exportName, "%s/%s", _rExportFolder, fst[i]->m_FullPath); + snprintf(exportName, sizeof(exportName), "%s/%s", _rExportFolder, fst[i]->m_FullPath); DEBUG_LOG(DISCIO, "%s", exportName); if (!File::Exists(exportName) && !FS->ExportFile(fst[i]->m_FullPath, exportName))