sprofile: fix off-by-one in struct definition, fix GetImportableProfileUrls

This commit is contained in:
Michael Scire
2021-10-29 15:41:25 -07:00
parent d1f3c4904b
commit 2a0b99d9f9
5 changed files with 59 additions and 18 deletions

View File

@@ -260,7 +260,7 @@ namespace ams::sprofile::srv {
crypto::Md5Generator md5;
md5.Update(std::addressof(import.header), sizeof(import.header));
md5.Update(std::addressof(import.metadata), sizeof(import.metadata));
md5.Update(std::addressof(import.entries), sizeof(import.entries[0]) * std::min<size_t>(import.metadata.num_entries, util::size(import.metadata.entries)));
md5.Update(std::addressof(import.profile_urls), sizeof(import.profile_urls[0]) * std::min<size_t>(import.metadata.num_entries, util::size(import.metadata.entries)));
u8 hash[crypto::Md5Generator::HashSize];
md5.GetHash(hash, sizeof(hash));