]> granicus.if.org Git - strace/blobdiff - netlink_unix_diag.c
print_array: enhance printing of unfetchable object addresses
[strace] / netlink_unix_diag.c
index 254a659fbcf5fdc14a14e25e84e29a5f7f7ae159..409180f5176d977eef89e069906dac91fc0aff2b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
  * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
- * Copyright (c) 2017 The strace developers.
+ * Copyright (c) 2017-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@ DECL_NETLINK_DIAG_DECODER(decode_unix_diag_req)
        if (len >= sizeof(req)) {
                if (!umoven_or_printaddr(tcp, addr + offset,
                                         sizeof(req) - offset,
-                                        (void *) &req + offset)) {
+                                        (char *) &req + offset)) {
                        PRINT_FIELD_U("", req, sdiag_protocol);
                        PRINT_FIELD_FLAGS(", ", req, udiag_states,
                                          tcp_state_flags, "1<<TCP_???");
@@ -107,7 +107,7 @@ decode_unix_diag_inode(struct tcb *const tcp,
                return false;
 
        print_array(tcp, addr, nmemb, &inode, sizeof(inode),
-                   umoven_or_printaddr, print_inode, 0);
+                   tfetch_mem, print_inode, 0);
 
        return true;
 }
@@ -153,7 +153,7 @@ DECL_NETLINK_DIAG_DECODER(decode_unix_diag_msg)
        if (len >= sizeof(msg)) {
                if (!umoven_or_printaddr(tcp, addr + offset,
                                         sizeof(msg) - offset,
-                                        (void *) &msg + offset)) {
+                                        (char *) &msg + offset)) {
                        PRINT_FIELD_XVAL("", msg, udiag_type,
                                         socktypes, "SOCK_???");
                        PRINT_FIELD_XVAL(", ", msg, udiag_state,