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>
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(", {");
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
}
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);