diff --git a/criu/page-xfer.c b/criu/page-xfer.c index aedb142b9..af02a3468 100644 --- a/criu/page-xfer.c +++ b/criu/page-xfer.c @@ -953,6 +953,7 @@ out: int get_remote_pages(int pid, unsigned long addr, int nr_pages, void *dest) { int ret; + int len = PAGE_SIZE * nr_pages; struct page_server_iov pi; @@ -972,8 +973,8 @@ int get_remote_pages(int pid, unsigned long addr, int nr_pages, void *dest) if (pi.nr_pages > nr_pages) return -1; - ret = recv(page_server_sk, dest, PAGE_SIZE, MSG_WAITALL); - if (ret != PAGE_SIZE) + ret = recv(page_server_sk, dest, len, MSG_WAITALL); + if (ret != len) return -1; return 1;