Don't assume that there will be another null byte

llvm-svn: 271029
This commit is contained in:
David Majnemer 2016-05-27 18:49:51 +00:00
parent ec73d8b383
commit bccdf597fb
1 changed files with 2 additions and 0 deletions

View File

@ -142,6 +142,8 @@ struct serialize_null_term_string_array_impl {
if (auto EC = consume(Data, Field))
return EC;
Item.push_back(Field);
if (Data.empty())
return std::make_error_code(std::errc::illegal_byte_sequence);
}
Data = Data.drop_front(1);
return std::error_code();