mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-12-01 19:51:31 +00:00
Error out when faced with value names containing '\0'
Bug found with afl-fuzz. llvm-svn: 252048
This commit is contained in:
1 parent
4305910803
commit
a2b0ac40cf
3 files changed
+9
-1
No files matched your search
@@ -1749,7 +1749,10 @@ ErrorOr<Value *> BitcodeReader::recordValue(SmallVectorImpl<uint64_t> &Record,
|
||||
return error("Invalid record");
|
||||
Value *V = ValueList[ValueID];
|
||||
|
||||
V->setName(StringRef(ValueName.data(), ValueName.size()));
|
||||
StringRef NameStr(ValueName.data(), ValueName.size());
|
||||
if (NameStr.find_first_of(0) != StringRef::npos)
|
||||
return error("Invalid value name");
|
||||
V->setName(NameStr);
|
||||
auto *GO = dyn_cast<GlobalObject>(V);
|
||||
if (GO) {
|
||||
if (GO->getComdat() == reinterpret_cast<Comdat *>(1)) {
|
||||
|
||||
Reference in new issue
Block a user