Index: third_party/protobuf/src/google/protobuf/wire_format_lite.cc |
=================================================================== |
--- third_party/protobuf/src/google/protobuf/wire_format_lite.cc (revision 216642) |
+++ third_party/protobuf/src/google/protobuf/wire_format_lite.cc (working copy) |
@@ -40,7 +40,7 @@ |
#include <google/protobuf/stubs/common.h> |
#include <google/protobuf/io/coded_stream_inl.h> |
#include <google/protobuf/io/zero_copy_stream.h> |
-#include <google/protobuf/io/zero_copy_stream_impl.h> |
+#include <google/protobuf/io/zero_copy_stream_impl_lite.h> |
#include <google/protobuf/unknown_field_set.h> |
namespace google { |
@@ -506,12 +506,14 @@ |
io::CodedOutputStream* output) { |
// String is for UTF-8 text only |
WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output); |
+ GOOGLE_CHECK(value.size() <= kint32max); |
output->WriteVarint32(value.size()); |
output->WriteString(value); |
} |
void WireFormatLite::WriteBytes(int field_number, const string& value, |
io::CodedOutputStream* output) { |
WriteTag(field_number, WIRETYPE_LENGTH_DELIMITED, output); |
+ GOOGLE_CHECK(value.size() <= kint32max); |
output->WriteVarint32(value.size()); |
output->WriteString(value); |
} |