llvm-undname: Fix oss-fuzz-foudn crash-on-invalid with incomplete special table nodes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358367 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nico Weber
2019-04-14 23:32:37 +00:00
parent 7fcf5b534e
commit 9fe9eec3d8
2 changed files with 14 additions and 0 deletions
+4
View File
@@ -276,6 +276,10 @@ Demangler::demangleSpecialTableSymbolNode(StringView &MangledName,
SpecialTableSymbolNode *STSN = Arena.alloc<SpecialTableSymbolNode>();
STSN->Name = QN;
bool IsMember = false;
if (MangledName.empty()) {
Error = true;
return nullptr;
}
char Front = MangledName.popFront();
if (Front != '6' && Front != '7') {
Error = true;