mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
syscall: fix use of uninitialized values
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é <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
committed by
Michael Tokarev
parent
bc658e4a2e
commit
6860710cc3
@@ -1622,6 +1622,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)
|
||||
|
||||
Reference in New Issue
Block a user