1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[COFFDumper] Make sure there is sufficient padding left in the string table

llvm-svn: 271146
This commit is contained in:
David Majnemer 2016-05-28 20:04:48 +00:00
parent 40cf622629
commit 35bdb1faa1

View File

@ -687,7 +687,10 @@ void COFFDumper::initializeFileAndStringTables(StringRef Data) {
default:
break;
}
Data = Data.drop_front(alignTo(SubSectionSize, 4));
uint32_t PaddedSize = alignTo(SubSectionSize, 4);
if (PaddedSize > Data.size())
error(object_error::parse_failed);
Data = Data.drop_front(PaddedSize);
}
}