From 3fbfa4335ef1705a4fa837cda0ed217bfb927521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 13 May 2018 23:17:35 +0200 Subject: [PATCH] WiiSave: Fix out-of-bounds read Fixes the count argument for WriteArray. (I used it like WriteBytes.) Whoops. --- Source/Core/Core/HW/WiiSave.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/WiiSave.cpp b/Source/Core/Core/HW/WiiSave.cpp index bdb514997c..89eab9202f 100644 --- a/Source/Core/Core/HW/WiiSave.cpp +++ b/Source/Core/Core/HW/WiiSave.cpp @@ -468,7 +468,7 @@ void WiiSave::do_sig() data_file.WriteArray(ap_sig.data(), ap_sig.size()); const u32 SIGNATURE_END_MAGIC = Common::swap32(0x2f536969); - data_file.WriteArray(&SIGNATURE_END_MAGIC, sizeof(SIGNATURE_END_MAGIC)); + data_file.WriteArray(&SIGNATURE_END_MAGIC, 1); const IOS::Certificate device_certificate = m_ios.GetIOSC().GetDeviceCertificate(); data_file.WriteArray(device_certificate.data(), device_certificate.size()); data_file.WriteArray(ap_cert.data(), ap_cert.size());