diff options
-rw-r--r-- | lib/Object/COFFObjectFile.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp index 158263e..0003807 100644 --- a/lib/Object/COFFObjectFile.cpp +++ b/lib/Object/COFFObjectFile.cpp @@ -309,8 +309,9 @@ COFFObjectFile::COFFObjectFile(MemoryBuffer *Object, error_code &ec) if (!checkSize(Data, ec, 0x3c + 8)) return; HeaderStart += *reinterpret_cast<const ulittle32_t *>(base() + 0x3c); // Check the PE header. ("PE\0\0") - if (StringRef(reinterpret_cast<const char *>(base() + HeaderStart), 4) - != "PE\0\0") { + StringRef Actual(reinterpret_cast<const char *>(base() + HeaderStart), 4); + StringRef Expcted("PE\0\0", 4); + if (Actual != Expcted) { ec = object_error::parse_failed; return; } |