]> granicus.if.org Git - strace/commitdiff
2007-01-12 Dmitry V. Levin <ldv@altlinux.org>
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 21 Mar 2007 14:18:17 +0000 (14:18 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 21 Mar 2007 14:18:17 +0000 (14:18 +0000)
* sock.c (sock_ioctl): Check umove() return code.

ChangeLog
sock.c

index ce767b3e4e7da51f392f2f1c07eba063f49bdaaf..b909850d9d68f0e93fdb26665fbbb280073cf669 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
 2007-01-12  Dmitry V. Levin <ldv@altlinux.org>
 
-       * sock.c (sock_ioctl) [LINUX]: Handle SIOCGIFTXQLEN and
-       SIOCGIFMAP.
+       * sock.c (sock_ioctl): Check umove() return code.
+       [LINUX] Handle SIOCGIFTXQLEN and SIOCGIFMAP.
 
 2007-03-16  Roland McGrath  <roland@redhat.com>
 
diff --git a/sock.c b/sock.c
index afcb7d8237589deec1aa9aef19c60e85ff52f07d..187ca5d86578e54fe25d7276d193e8204e3bb7c1 100644 (file)
--- a/sock.c
+++ b/sock.c
@@ -93,8 +93,8 @@ sock_ioctl(struct tcb *tcp, long code, long arg)
 
        if (entering(tcp)) {
                if (code == SIOCGIFCONF) {
-                       umove(tcp, tcp->u_arg[2], &ifc);
-                       if (ifc.ifc_buf == NULL)
+                       if (umove(tcp, tcp->u_arg[2], &ifc) >= 0
+                           && ifc.ifc_buf == NULL)
                                tprintf(", {%d -> ", ifc.ifc_len);
                        else
                                tprintf(", {");
@@ -146,8 +146,9 @@ sock_ioctl(struct tcb *tcp, long code, long arg)
        case SIOCGIFHWADDR:
        case SIOCGIFTXQLEN:
        case SIOCGIFMAP:
-               umove(tcp, tcp->u_arg[2], &ifr);
-                if (syserror(tcp)) {
+               if (umove(tcp, tcp->u_arg[2], &ifr) < 0)
+                       tprintf(", %#lx", tcp->u_arg[2]);
+               else if (syserror(tcp)) {
                        if (code == SIOCGIFNAME)
                                tprintf(", {ifr_index=%d, ifr_name=???}", ifr.ifr_ifindex);
                        else
@@ -223,7 +224,10 @@ sock_ioctl(struct tcb *tcp, long code, long arg)
                }
                return 1;
        case SIOCGIFCONF:
-               umove(tcp, tcp->u_arg[2], &ifc);
+               if (umove(tcp, tcp->u_arg[2], &ifc) < 0) {
+                       tprintf("???}");
+                       return 1;
+               }
                tprintf("%d, ", ifc.ifc_len);
                 if (syserror(tcp)) {
                        tprintf("%lx", (unsigned long) ifc.ifc_buf);