File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -3243,6 +3243,8 @@ Error BitcodeReader::parseComdatRecord(ArrayRef<uint64_t> Record) {
3243
3243
if (Record.size () < 2 )
3244
3244
return error (" Invalid record" );
3245
3245
unsigned ComdatNameSize = Record[1 ];
3246
+ if (ComdatNameSize > Record.size () - 2 )
3247
+ return error (" Comdat name size too large" );
3246
3248
OldFormatName.reserve (ComdatNameSize);
3247
3249
for (unsigned i = 0 ; i != ComdatNameSize; ++i)
3248
3250
OldFormatName += (char )Record[2 + i];
Original file line number Diff line number Diff line change @@ -271,3 +271,8 @@ RUN: not llvm-dis -disable-output %p/Inputs/unterminated-vbr.bc 2>&1 | \
271
271
RUN: FileCheck --check-prefix=UNTERMINATED-VBR %s
272
272
273
273
UNTERMINATED-VBR: Unterminated VBR
274
+
275
+ RUN: not llvm-dis -disable-output %p/Inputs/comdat-name-too-large.bc 2>&1 | \
276
+ RUN: FileCheck --check-prefix=COMDAT-NAME-TOO-LARGE %s
277
+
278
+ COMDAT-NAME-TOO-LARGE: Comdat name size too large
You can’t perform that action at this time.
0 commit comments