diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-07-12 13:02:17 +0100 |
---|---|---|
committer | Riku Voipio <riku.voipio@linaro.org> | 2016-09-21 14:28:03 +0300 |
commit | 772034b63e9c0caf6c92e31413f2d8df2ee69c88 (patch) | |
tree | 0c96a6bbee795fc6ba592e7df5c230afd709a9ca | |
parent | e5a869ed569a97fa676e9827952629086ec41f4e (diff) | |
download | qemu-772034b63e9c0caf6c92e31413f2d8df2ee69c88.tar.gz qemu-772034b63e9c0caf6c92e31413f2d8df2ee69c88.tar.bz2 qemu-772034b63e9c0caf6c92e31413f2d8df2ee69c88.zip |
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>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
-rw-r--r-- | linux-user/elfload.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index e9a3882bef..0d07b85cb8 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3050,7 +3050,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; + } } /* |