mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
remote: handle partial data transmission
A new bug was introduced as a part of use-after-free fix below: commit 411cbe7199ce533ae5fa78f5558dddca6f88ef1a Author: Oleg Vasilev <oleg.vasilev@virtuozzo.com> Date: Tue Jul 4 13:10:22 2023 +0600 remote: fix stream use-after-free When the message was processed partially, it is actually supposed to stay in the queue to be processed again. In such case, reinsert it back. Signed-off-by: Oleg Vasilev <oleg.vasilev@virtuozzo.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
0cec8abdba
commit
ea4c67f567
@ -775,8 +775,12 @@ daemonStreamHandleWrite(virNetServerClient *client,
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
if (ret > 0)
|
||||
break; /* still processing data from msg */
|
||||
if (ret > 0) {
|
||||
/* still processing data from msg, put it back into queue */
|
||||
msg->next = stream->rx;
|
||||
stream->rx = msg;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
virNetMessageFree(msg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user