Prevent python plugin from crashing with InvalidWireType exception

Too much data was passed to wrapper.parseFromString resulting in it
trying to read another tag even after the WrapperMessage has ended
This commit is contained in:
moyamo 2015-10-09 18:53:52 +02:00
parent d8e0d03cc0
commit 5002dce4a9

View file

@ -319,7 +319,7 @@ class NetworkPlugin:
return
wrapper = protocol_pb2.WrapperMessage()
if (wrapper.ParseFromString(self.m_data[4:]) == False):
if (wrapper.ParseFromString(self.m_data[4:expected_size+4]) == False):
self.m_data = self.m_data[expected_size+4:]
return