aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-09-06 10:36:40 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-09-06 10:36:40 +0100
commitac446bf7850bb1eb55322f023b16fb816e94a4a9 (patch)
tree1cc7a5ef24861f3eab645e80bfdaf5f09c531d23
parente5ee11453b253d19d47a1b35eaa287536543654d (diff)
linux-user: Check dump_write() return in elf_core_dump()
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 <peter.maydell@linaro.org>
-rw-r--r--linux-user/elfload.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 38e210e40e..7c46cfba40 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;
+ }
}
/*