forked from OSchip/llvm-project
[SymbolDumper] Validate the string table offset before using it
llvm-svn: 271145
This commit is contained in:
parent
898eb39bfc
commit
c6cb2ec36e
|
@ -591,12 +591,12 @@ void CVSymbolDumperImpl::visitDefRangeSubfieldSym(
|
|||
|
||||
if (ObjDelegate) {
|
||||
StringRef StringTable = ObjDelegate->getStringTable();
|
||||
if (!StringTable.empty()) {
|
||||
W.printString("Program",
|
||||
StringTable.drop_front(DefRangeSubfield.Header.Program)
|
||||
.split('\0')
|
||||
.first);
|
||||
}
|
||||
auto ProgramStringTableOffset = DefRangeSubfield.Header.Program;
|
||||
if (ProgramStringTableOffset >= StringTable.size())
|
||||
return parseError();
|
||||
StringRef Program =
|
||||
StringTable.drop_front(ProgramStringTableOffset).split('\0').first;
|
||||
W.printString("Program", Program);
|
||||
}
|
||||
W.printNumber("OffsetInParent", DefRangeSubfield.Header.OffsetInParent);
|
||||
printLocalVariableAddrRange(DefRangeSubfield.Header.Range,
|
||||
|
|
Loading…
Reference in New Issue