diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c index c3a2e595c130b98f4bd95afe31bdd9109690548c..5908b074a86c18288849e89cc21679e8bee4b84d 100644 --- a/src/rpc/virnetmessage.c +++ b/src/rpc/virnetmessage.c @@ -358,7 +358,8 @@ int virNetMessageEncodePayload(virNetMessagePtr msg, /* Try to encode the payload. If the buffer is too small increase it. */ while (!(*filter)(&xdr, data, 0)) { - unsigned int newlen = (msg->bufferLength - VIR_NET_MESSAGE_LEN_MAX) * 4; + unsigned int newlen = msg->bufferLength - VIR_NET_MESSAGE_LEN_MAX; + newlen *= 2; if (newlen > VIR_NET_MESSAGE_MAX) { virReportError(VIR_ERR_RPC, "%s", _("Unable to encode message payload"));