[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PULL 15/25] syscall: fix dereference of
From: |
Peter Maydell |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PULL 15/25] syscall: fix dereference of undefined pointer |
Date: |
Mon, 31 Jul 2017 14:01:10 +0100 |
On 31 July 2017 at 11:21, Michael Tokarev <address@hidden> wrote:
> From: Philippe Mathieu-Daudé <address@hidden>
>
> linux-user/syscall.c:5581:9: warning: Dereference of undefined pointer value
> if (*host_rt_dev_ptr != 0) {
> ^~~~~~~~~~~~~~~~
>
> Reported-by: Clang Static Analyzer
> Suggested-by: Laurent Vivier <address@hidden>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> Reviewed-by: Laurent Vivier <address@hidden>
> Signed-off-by: Michael Tokarev <address@hidden>
> ---
> linux-user/syscall.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 003943b736..71d45a9963 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -5573,6 +5573,7 @@ static abi_long do_ioctl_rt(const IOCTLEntry *ie,
> uint8_t *buf_temp,
> field_types, THUNK_HOST);
> }
> unlock_user(argptr, arg, 0);
> + assert(host_rt_dev_ptr);
>
> ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
> if (*host_rt_dev_ptr != 0) {
> --
This appears not to build with all versions of gcc; the ones in my
test set were fine but the gcc 4.6.3 that some of the travis
configs use complains:
linux-user/syscall.c: In function 'do_ioctl_rt':
linux-user/syscall.c:5577:37: error: 'host_rt_dev_ptr' may be used uninitialized
It's not obvious to me that the compiler is wrong, either,
though why it complains about the assert but not the if()
I have no idea.
In any case, I'm going to revert this commit to fix the
Travis builds; we can have another go at it later.
thanks
-- PMM
- [Qemu-trivial] [PULL 19/25] docs: fix broken paths to docs/interop dir, (continued)
- [Qemu-trivial] [PULL 19/25] docs: fix broken paths to docs/interop dir, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 08/25] loader: check get_image_size() return value, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 18/25] thunk: assert nb_fields is valid, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 17/25] syscall: check inotify() and eventfd() return value, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 03/25] MAINTAINERS: Improve the NetBSD regex pattern, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 22/25] docs: fix broken paths to docs/devel/atomics.txt, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 11/25] ui/vnc: fix leak of SocketAddress **, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 21/25] docs: fix broken paths to docs/devel/qapi-code-gen.txt, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 20/25] docs: fix broken paths to docs/interop/qcow2.txt, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 15/25] syscall: fix dereference of undefined pointer, Michael Tokarev, 2017/07/31
- Re: [Qemu-trivial] [Qemu-devel] [PULL 15/25] syscall: fix dereference of undefined pointer,
Peter Maydell <=
- [Qemu-trivial] [PULL 25/25] docs: fix broken paths to docs/specs/ivshmem-spec.txt, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 14/25] linux-user/sh4: fix incorrect memory write, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 05/25] build-sys: there is no qemu-ga.c, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 01/25] tests: check-qom-proplist: fix leak, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 24/25] docs: fix broken paths to docs/config/ich9-ehci-uhci.cfg, Michael Tokarev, 2017/07/31
- [Qemu-trivial] [PULL 23/25] docs: fix broken paths to docs/devel/tracing.txt, Michael Tokarev, 2017/07/31
- Re: [Qemu-trivial] [Qemu-devel] [PULL 00/25 for-2.10] Trivial patches for 2017-07-31, Peter Maydell, 2017/07/31