[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/8] linux-user: Check dump_write() return in elf_co
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH 6/8] linux-user: Check dump_write() return in elf_core_dump() |
Date: |
Tue, 12 Jul 2016 13:02:17 +0100 |
One of the calls to dump_write() in elf_core_dump() was missing
a check for failure (spotted by Coverity). Add the check to
bring it into line with the other calls from this function.
Signed-off-by: Peter Maydell <address@hidden>
---
linux-user/elfload.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 38e210e..7c46cfb 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -3053,7 +3053,9 @@ static int elf_core_dump(int signr, const CPUArchState
*env)
phdr.p_align = ELF_EXEC_PAGESIZE;
bswap_phdr(&phdr, 1);
- dump_write(fd, &phdr, sizeof (phdr));
+ if (dump_write(fd, &phdr, sizeof(phdr)) != 0) {
+ goto out;
+ }
}
/*
--
1.9.1
- [Qemu-devel] [PATCH 0/8] linux-user: fix various coverity nits, Peter Maydell, 2016/07/12
- [Qemu-devel] [PATCH 1/8] linux-user: Pass missing MAP_ANONYMOUS to target_mmap() call, Peter Maydell, 2016/07/12
- [Qemu-devel] [PATCH 2/8] linux-user: Check lock_user() return value for NULL, Peter Maydell, 2016/07/12
- [Qemu-devel] [PATCH 5/8] linux-user: Don't write off end of new_utsname buffer, Peter Maydell, 2016/07/12
- [Qemu-devel] [PATCH 7/8] linux-user: Use glib malloc functions in load_symbols(), Peter Maydell, 2016/07/12
- [Qemu-devel] [PATCH 6/8] linux-user: Check dump_write() return in elf_core_dump(),
Peter Maydell <=
- [Qemu-devel] [PATCH 4/8] linux-user: Fix error handling in flatload.c target_pread(), Peter Maydell, 2016/07/12
- [Qemu-devel] [PATCH 3/8] linux-user: Fix incorrect use of host errno in do_ioctl_dm(), Peter Maydell, 2016/07/12
- [Qemu-devel] [PATCH 8/8] linux-user: Fix memchr() argument in open_self_cmdline(), Peter Maydell, 2016/07/12
- Re: [Qemu-devel] [PATCH 0/8] linux-user: fix various coverity nits, Paolo Bonzini, 2016/07/12