summaryrefslogtreecommitdiff
path: root/sock.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2009-11-03 14:38:44 +0000
committerDmitry V. Levin <ldv@altlinux.org>2009-11-06 17:27:46 +0000
commit62e0596dbda6831f7f7a976c183373d5ff7a7584 (patch)
tree6ee9808364ea50b6093fc1f925754b73aa04a627 /sock.c
parentf0df31e71a58c6e79ba77c1a9d84b2f38d44bec7 (diff)
downloadstrace-62e0596dbda6831f7f7a976c183373d5ff7a7584.tar.gz
strace-62e0596dbda6831f7f7a976c183373d5ff7a7584.tar.bz2
strace-62e0596dbda6831f7f7a976c183373d5ff7a7584.tar.xz
Check umove() return code
* bjm.c (sys_query_module): Print input parameters when entering syscall. Fix handling of syscall error. Handle unlikely umove() failures. * ipc.c (tprint_msgrcv): New function. Move part of msgrcv parser code here, add check umove() return code. (sys_msgsnd): Print msqid parameter as int instead of long. (sys_msgrcv): Likewise. Use tprint_msgrcv(). * process.c (print_affinitylist): Check umove() return code. * sock.c (sock_ioctl): Handle unlikely umove() failure in the SIOCGIFCONF parser.
Diffstat (limited to 'sock.c')
-rw-r--r--sock.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sock.c b/sock.c
index 670f72b..e7c72b5 100644
--- a/sock.c
+++ b/sock.c
@@ -258,8 +258,12 @@ sock_ioctl(struct tcb *tcp, long code, long arg)
int i;
unsigned nifra = ifc.ifc_len / sizeof(struct ifreq);
struct ifreq ifra[nifra];
- umoven(tcp, (unsigned long) ifc.ifc_buf, sizeof(ifra),
- (char *) ifra);
+
+ if (umoven(tcp, (unsigned long) ifc.ifc_buf,
+ sizeof(ifra), (char *) ifra) < 0) {
+ tprintf("%lx}", (unsigned long) ifc.ifc_buf);
+ return 1;
+ }
tprintf("{");
for (i = 0; i < nifra; ++i ) {
if (i > 0)