summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-05-28 05:59:22 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-05-28 05:59:22 +0000
commita429581787a19a8a2f3876e4665492fd9e05fb62 (patch)
treed0ace46ff1b8a6e9e6329c944344e665ffdbcd71 /llvm
parent7e950b261ab2da7b385f01dae7afd1f38b87659b (diff)
downloadbcm5719-llvm-a429581787a19a8a2f3876e4665492fd9e05fb62.tar.gz
bcm5719-llvm-a429581787a19a8a2f3876e4665492fd9e05fb62.zip
An empty record cannot be null-terminated
llvm-svn: 271104
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h b/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h
index ef44f9d9418..84179f5f81f 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h
@@ -140,6 +140,9 @@ struct serialize_null_term_string_array_impl {
: Item(Item) {}
std::error_code deserialize(ArrayRef<uint8_t> &Data) const {
+ if (Data.empty())
+ return std::make_error_code(std::errc::illegal_byte_sequence);
+
StringRef Field;
// Stop when we run out of bytes or we hit record padding bytes.
while (Data.front() != 0) {
OpenPOWER on IntegriCloud