[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH for 2.10 30/35] syscall: fix use of uninitiali
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-trivial] [PATCH for 2.10 30/35] syscall: fix use of uninitialized values |
Date: |
Mon, 24 Jul 2017 21:51:06 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
Le 24/07/2017 à 20:27, Philippe Mathieu-Daudé a écrit :
> linux-user/syscall.c:1627:35: warning: 1st function call argument is an
> uninitialized value
> target_saddr->sa_family = tswap16(addr->sa_family);
> ^~~~~~~~~~~~~~~~~~~~~~~~
> linux-user/syscall.c:1629:25: warning: The left operand of '==' is a garbage
> value
> if (addr->sa_family == AF_NETLINK && len >= sizeof(struct sockaddr_nl)) {
> ~~~~~~~~~~~~~~~ ^
>
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <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 26450d235f..963b9c8f4b 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -1618,6 +1618,7 @@ static inline abi_long
> host_to_target_sockaddr(abi_ulong target_addr,
> if (len == 0) {
> return 0;
> }
> + assert(addr);
>
> target_saddr = lock_user(VERIFY_WRITE, target_addr, len, 0);
> if (!target_saddr)
>
Reviewed-by: Laurent Vivier <address@hidden>
- [Qemu-trivial] [PATCH for 2.10 27/35] syscall: fix dereference of undefined pointer, (continued)
- [Qemu-trivial] [PATCH for 2.10 27/35] syscall: fix dereference of undefined pointer, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-trivial] [PATCH for 2.10 26/35] linux-user: use is_error() to avoid warnings and make the code clearer, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-trivial] [PATCH for 2.10 29/35] syscall: fix out-of-bound memory access, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-trivial] [PATCH for 2.10 30/35] syscall: fix use of uninitialized values, Philippe Mathieu-Daudé, 2017/07/24
- Re: [Qemu-trivial] [PATCH for 2.10 30/35] syscall: fix use of uninitialized values,
Laurent Vivier <=
- [Qemu-trivial] [PATCH for 2.10 31/35] syscall: replace strcpy() by g_strlcpy(), Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-trivial] [PATCH for 2.10 32/35] timer/pxa2xx: silent warning about out-of-bound memory access, Philippe Mathieu-Daudé, 2017/07/24
- [Qemu-trivial] [RFC PATCH for 2.10 35/35] script to run docker image, Philippe Mathieu-Daudé, 2017/07/24