From c02c5650c04c8083825e841409555d0177740e12 Mon Sep 17 00:00:00 2001 From: jakcron Date: Sat, 21 Apr 2018 17:27:29 +0800 Subject: [PATCH] [nx] NcaHeader signature bytes validation change. --- lib/libnx/source/NcaHeader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libnx/source/NcaHeader.cpp b/lib/libnx/source/NcaHeader.cpp index f8dd2f2..9ceadb0 100644 --- a/lib/libnx/source/NcaHeader.cpp +++ b/lib/libnx/source/NcaHeader.cpp @@ -74,11 +74,12 @@ void NcaHeader::importBinary(const byte_t * bytes, size_t len) sNcaHeader* hdr = (sNcaHeader*)mBinaryBlob.getBytes(); - if (memcmp(hdr->signature, nca::kNca2Sig.c_str(), 4) == 0) + std::string sig = std::string(hdr->signature, 4); + if (sig == nca::kNca2Sig) { mFormatVersion = NCA2_FORMAT; } - else if (memcmp(hdr->signature, nca::kNca3Sig.c_str(), 4) == 0) + else if (sig == nca::kNca3Sig) { mFormatVersion = NCA3_FORMAT; }