summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Demangle
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Demangle')
-rw-r--r--llvm/lib/Demangle/MicrosoftDemangle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Demangle/MicrosoftDemangle.cpp b/llvm/lib/Demangle/MicrosoftDemangle.cpp
index 6431e4ab130..b421f2a7f93 100644
--- a/llvm/lib/Demangle/MicrosoftDemangle.cpp
+++ b/llvm/lib/Demangle/MicrosoftDemangle.cpp
@@ -1292,7 +1292,7 @@ Demangler::demangleStringLiteral(StringView &MangledName) {
unsigned BytesDecoded = 0;
while (!MangledName.consumeFront('@')) {
- if (MangledName.size() < 1)
+ if (MangledName.size() < 1 || BytesDecoded >= MaxStringByteLength)
goto StringLiteralError;
StringBytes[BytesDecoded++] = demangleCharLiteral(MangledName);
}
OpenPOWER on IntegriCloud