mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
restore: Check for incomplete reading of vma-entry
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
@@ -698,9 +698,14 @@ static int fixup_vma_fds(int pid, int fd)
|
||||
|
||||
while (1) {
|
||||
struct vma_entry vi;
|
||||
int ret = 0;
|
||||
|
||||
if (read(fd, &vi, sizeof(vi)) != sizeof(vi)) {
|
||||
ret = read(fd, &vi, sizeof(vi));
|
||||
if (ret < 0) {
|
||||
pr_perror("%d: Can't read vma_entry\n", pid);
|
||||
} else if (ret != sizeof(vi)) {
|
||||
pr_err("%d: Incomplete vma_entry (%d != %d)\n",
|
||||
pid, ret, sizeof(vi));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user