Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
qemu.2059
0139-ivshmem-check-the-value-returned-by.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0139-ivshmem-check-the-value-returned-by.patch of Package qemu.2059
From 5c1765a6c3fb09d1c23c0c54b6a5c4840702c92b Mon Sep 17 00:00:00 2001 From: zhanghailiang <zhang.zhanghailiang@huawei.com> Date: Thu, 14 Aug 2014 15:29:15 +0800 Subject: [PATCH] ivshmem: check the value returned by fstat() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function fstat() may fail, so check its return value. Acked-by: Levente Kurusa <lkurusa@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> (cherry picked from commit 5edbdbcdf882e4220adc7dbf433351077cd1fbbc) [AF: FATE#314468] Signed-off-by: Andreas Färber <afaerber@suse.de> --- hw/misc/ivshmem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 8d144ba..683e2c0 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -324,7 +324,11 @@ static int check_shm_size(IVShmemState *s, int fd) { struct stat buf; - fstat(fd, &buf); + if (fstat(fd, &buf) < 0) { + fprintf(stderr, "ivshmem: exiting: fstat on fd %d failed: %s\n", + fd, strerror(errno)); + return -1; + } if (s->ivshmem_size > buf.st_size) { fprintf(stderr,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor