util/vhost-user-server: check EOF when reading payload
Unexpected EOF is an error that must be reported. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20200924151549.913737-9-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
8c7f7cbca0
commit
edaf6205a3
@ -169,8 +169,10 @@ vu_message_read(VuDev *vu_dev, int conn_fd, VhostUserMsg *vmsg)
|
||||
};
|
||||
if (vmsg->size) {
|
||||
rc = qio_channel_readv_all_eof(ioc, &iov_payload, 1, &local_err);
|
||||
if (rc == -1) {
|
||||
error_report_err(local_err);
|
||||
if (rc != 1) {
|
||||
if (local_err) {
|
||||
error_report_err(local_err);
|
||||
}
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user