Commit 6f0d992a authored by baire's avatar baire
Browse files

fixed possible overflow

parent adb6de0f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1227,7 +1227,10 @@ void Payload::PreDecode(Buffer& buffer) throw (DecodeError)
{
	// FIXME: this is not very clean
	// 	  -> should provide a way to skip a field in the decoder
	buffer.SetPosition(buffer.GetPosition() - Get_payloadlength().GetLength());
	int offset=buffer.GetPosition() - Get_payloadlength().GetLength();
	if (offset < 0)
		throw DecodeError (this, "Unable to decode Payload");
	buffer.SetPosition(offset);
}

void Payload::PostDecode(Buffer& buffer) throw (DecodeError)