migration/rdma: Fix unwanted integer truncation
commit25352b371b37b038d50b75ec0a3557e77f1d74e3
authorMarkus Armbruster <armbru@redhat.com>
Thu, 28 Sep 2023 13:19:32 +0000 (28 15:19 +0200)
committerJuan Quintela <quintela@redhat.com>
Wed, 11 Oct 2023 09:17:03 +0000 (11 11:17 +0200)
tree213ee700c3243880de055a13feabca553b19c5a1
parent87a24ca3f2054d1b3268ceb141751a1fff32cc9c
migration/rdma: Fix unwanted integer truncation

qio_channel_rdma_readv() assigns the size_t value of qemu_rdma_fill()
to an int variable before it adds it to @done / subtracts it from
@want, both size_t.  Truncation when qemu_rdma_fill() copies more than
INT_MAX bytes.  Seems vanishingly unlikely, but needs fixing all the
same.

Fixes: 6ddd2d76ca6f (migration: convert RDMA to use QIOChannel interface)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230928132019.2544702-7-armbru@redhat.com>
migration/rdma.c