|
@@ -452,14 +452,14 @@ PTHManager *PTHManager::Create(const std::string &file,
|
|
|
const unsigned char *BufEnd = (unsigned char*)File->getBufferEnd();
|
|
|
|
|
|
// Check the prologue of the file.
|
|
|
- if ((BufEnd - BufBeg) < (signed)(sizeof("cfe-pth") + 3 + 4) ||
|
|
|
- memcmp(BufBeg, "cfe-pth", sizeof("cfe-pth") - 1) != 0) {
|
|
|
+ if ((BufEnd - BufBeg) < (signed)(sizeof("cfe-pth") + 4 + 4) ||
|
|
|
+ memcmp(BufBeg, "cfe-pth", sizeof("cfe-pth")) != 0) {
|
|
|
Diags.Report(diag::err_invalid_pth_file) << file;
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
// Read the PTH version.
|
|
|
- const unsigned char *p = BufBeg + (sizeof("cfe-pth") - 1);
|
|
|
+ const unsigned char *p = BufBeg + (sizeof("cfe-pth"));
|
|
|
unsigned Version = ReadLE32(p);
|
|
|
|
|
|
if (Version < PTHManager::Version) {
|