]> granicus.if.org Git - strace/blobdiff - aio.c
Robustify mpers.awk against invalid input
[strace] / aio.c
diff --git a/aio.c b/aio.c
index f8c73358369dbd8a18f659d3722876a89a56ac79..1cbd533a051a38bf70193ecfea1b87ed3dea29cb 100644 (file)
--- a/aio.c
+++ b/aio.c
@@ -164,13 +164,13 @@ SYS_FUNC(io_submit)
                long iocbs = tcp->u_arg[2];
 
                for (i = 0; i < nr; ++i, iocbs += current_wordsize) {
-                       long iocbp;
+                       unsigned long iocbp;
                        struct iocb cb;
 
                        if (i)
                                tprints(", ");
 
-                       if (umove_long_or_printaddr(tcp, iocbs, &iocbp)) {
+                       if (umove_ulong_or_printaddr(tcp, iocbs, &iocbp)) {
                                /*
                                 * No point in trying to read the whole array
                                 * because nr can be ridiculously large.
@@ -244,7 +244,14 @@ SYS_FUNC(io_getevents)
                        tprints("], ");
                }
 
+               /*
+                * Since the timeout parameter is read by the kernel
+                * on entering syscall, it has to be decoded the same way
+                * whether the syscall has failed or not.
+                */
+               temporarily_clear_syserror(tcp);
                print_timespec(tcp, tcp->u_arg[4]);
+               restore_cleared_syserror(tcp);
        }
        return 0;
 }