mirror of
https://github.com/RPCS3/llvm.git
synced 2026-01-31 01:25:19 +01:00
Fix use after free in BinaryStream library.
This was reported by the ASAN bot, and it turned out to be a fairly fundamental problem with the design of VarStreamArray and the way it passes context information to the extractor. The fix was cumbersome, and I'm not entirely pleased with it, so I plan to revisit this design in the future when I'm not pressed to get the bots green again. For now, this fixes the issue by storing the context information by value instead of by reference, and introduces some impossibly-confusing template magic to make things "work". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301999 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -25,7 +25,7 @@ struct FileChecksumEntryHeader {
|
||||
};
|
||||
|
||||
Error llvm::VarStreamArrayExtractor<FileChecksumEntry>::extract(
|
||||
BinaryStreamRef Stream, uint32_t &Len, FileChecksumEntry &Item, void *Ctx) {
|
||||
BinaryStreamRef Stream, uint32_t &Len, FileChecksumEntry &Item) {
|
||||
BinaryStreamReader Reader(Stream);
|
||||
|
||||
const FileChecksumEntryHeader *Header;
|
||||
|
||||
Reference in New Issue
Block a user