mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
Ensure RPC message is cleared before being reused
To save on memory reallocation, virNetMessage instances that have been transmitted, may be reused for a subsequent incoming message. We forgot to clear out the old data of the message fully, which caused later confusion upon read. * src/rpc/virnetserverclient.c: memset entire message before reusing it
This commit is contained in:
parent
27111b350f
commit
d840fe93b0
@ -837,6 +837,7 @@ virNetServerClientDispatchWrite(virNetServerClientPtr client)
|
||||
client->nrequests < client->nrequests_max) {
|
||||
/* Ready to recv more messages */
|
||||
client->rx = msg;
|
||||
memset(client->rx, 0, sizeof(*client->rx));
|
||||
client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX;
|
||||
msg = NULL;
|
||||
client->nrequests++;
|
||||
|
Loading…
Reference in New Issue
Block a user