llvm.org GIT mirror llvm / 2f10db7
llvm-undname: Fix stack overflow on invalid found by oss-fuzz git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358852 91177308-0d34-0410-b5e6-96231b3b80d8 Nico Weber 1 year, 7 months ago
2 changed file(s) with 6 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
12911291
12921292 unsigned BytesDecoded = 0;
12931293 while (!MangledName.consumeFront('@')) {
1294 if (MangledName.size() < 1)
1294 if (MangledName.size() < 1 || BytesDecoded >= MaxStringByteLength)
12951295 goto StringLiteralError;
12961296 StringBytes[BytesDecoded++] = demangleCharLiteral(MangledName);
12971297 }
158158 ; CHECK-EMPTY:
159159 ; CHECK-NEXT: ??_C@_1301234567@a
160160 ; CHECK-NEXT: error: Invalid mangled name
161
162 ??_C@_0601234567@abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyz
163 ; CHECK-EMPTY:
164 ; CHECK-NEXT: ??_C@_0601234567@abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyz
165 ; CHECK-NEXT: error: Invalid mangled name