From 5bd5178a7d83e4ebb0472025d3f11975358dc956 Mon Sep 17 00:00:00 2001 From: jakcron Date: Fri, 7 Jul 2017 09:57:50 +1000 Subject: [PATCH] [nx] Safer FacBinary size calculation in FacHeader. --- lib/nx/FacHeader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nx/FacHeader.cpp b/lib/nx/FacHeader.cpp index 1a7187c..b34bf8f 100644 --- a/lib/nx/FacHeader.cpp +++ b/lib/nx/FacHeader.cpp @@ -86,7 +86,7 @@ void FacHeader::importBinary(const u8 * bytes, size_t len) u64 FacHeader::getFacSize() const { - return getSaveDataOwnerIdOffset() + getSaveDataOwnerIdSize(); + return MAX(getSaveDataOwnerIdOffset() + getSaveDataOwnerIdSize(), getContentOwnerIdOffset() + getContentOwnerIdSize()); } u64 FacHeader::getFsaRights() const