]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
syscall: fix dereference of undefined pointer
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Thu, 27 Jul 2017 02:42:17 +0000 (23:42 -0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 31 Jul 2017 10:06:39 +0000 (13:06 +0300)
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 <lvivier@redhat.com>
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>
linux-user/syscall.c

index 003943b736531e21806cc7ef4c1bbd0e918f05b7..71d45a9963f0a2e0a634c52222d44ae293632250 100644 (file)
@@ -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) {