From bccdf597fbcdab352752552f781169639e6d402a Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Fri, 27 May 2016 18:49:51 +0000 Subject: [PATCH] Don't assume that there will be another null byte llvm-svn: 271029 --- llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h b/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h index c93e5ad46e94..0a11536e0de8 100644 --- a/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h +++ b/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h @@ -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();