Commit 7ce27610 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

restore: Check for incomplete reading of vma-entry

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 2beec226
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment