mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Add some safety to file names. This fixes a buffer overrun when extracting everything from an ISO.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5537 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -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))
|
||||
|
Reference in New Issue
Block a user