Skip to content

Commit

Permalink
syscall: fix use of uninitialized values
Browse files Browse the repository at this point in the history
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é <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
  • Loading branch information
philmd authored and Michael Tokarev committed Jul 31, 2017
1 parent bc658e4 commit 6860710
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions linux-user/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6860710

Please sign in to comment.