aboutsummaryrefslogtreecommitdiff
path: root/python/google/protobuf/pyext/message.cc
diff options
context:
space:
mode:
authorJisi Liu <jisi.liu@gmail.com>2017-10-18 12:22:18 -0700
committerJisi Liu <jisi.liu@gmail.com>2017-10-18 12:22:18 -0700
commit1a7a7fca804afa1cf67f8be5e71092898ba40334 (patch)
tree04b3da27c71c607510f34a12cf7856a1b94181ae /python/google/protobuf/pyext/message.cc
parentc4f59dcc5c13debc572154c8f636b8a9361aacde (diff)
downloadprotobuf-1a7a7fca804afa1cf67f8be5e71092898ba40334.tar.gz
protobuf-1a7a7fca804afa1cf67f8be5e71092898ba40334.tar.bz2
protobuf-1a7a7fca804afa1cf67f8be5e71092898ba40334.zip
Merge from google internal
Diffstat (limited to 'python/google/protobuf/pyext/message.cc')
-rw-r--r--python/google/protobuf/pyext/message.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc
index 0f54506b..ef75acab 100644
--- a/python/google/protobuf/pyext/message.cc
+++ b/python/google/protobuf/pyext/message.cc
@@ -2065,6 +2065,11 @@ static PyObject* MergeFromString(CMessage* self, PyObject* arg) {
input.SetExtensionRegistry(factory->pool->pool, factory->message_factory);
bool success = self->message->MergePartialFromCodedStream(&input);
if (success) {
+ if (!input.ConsumedEntireMessage()) {
+ // TODO(jieluo): Raise error and return NULL instead.
+ // b/27494216
+ PyErr_Warn(NULL, "Unexpected end-group tag: Not all data was converted");
+ }
return PyInt_FromLong(input.CurrentPosition());
} else {
PyErr_Format(DecodeError_class, "Error parsing message");