[llvm] r271029 - Don't assume that there will be another null byte

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Fri May 27 11:49:51 PDT 2016


Author: majnemer
Date: Fri May 27 13:49:51 2016
New Revision: 271029

URL: http://llvm.org/viewvc/llvm-project?rev=271029&view=rev
Log:
Don't assume that there will be another null byte

Modified:
    llvm/trunk/include/llvm/DebugInfo/CodeView/RecordSerialization.h

Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/RecordSerialization.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/RecordSerialization.h?rev=271029&r1=271028&r2=271029&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/RecordSerialization.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/RecordSerialization.h Fri May 27 13:49:51 2016
@@ -142,6 +142,8 @@ struct serialize_null_term_string_array_
       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();




More information about the llvm-commits mailing list