Fix decoding and dumping of readv syscall in case of short read
* defs.h (dumpiov_upto): New prototype.
(dumpiov): Change to a wrapper around dumpiov_upto.
* util.c (dumpiov): Rename to dumpiov_upto, add and check data_size
argument.
* io.c (SYS_FUNC(readv)): Call tprint_iov_upto instead
of tprint_iov and specify syscall return value as a data size limit.
* syscall.c (dumpio): In case of SEN_readv, call dumpiov_upto instead
of dumpiov and specify syscall return value as a data size limit.
* NEWS: Mention this fix.
* tests/readv.c: New file.
* tests/readv.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add readv.
(TESTS): Add readv.test.
* tests/.gitignore: Add readv.
diff --git a/io.c b/io.c
index 5ee967c..b98bc8a 100644
--- a/io.c
+++ b/io.c
@@ -123,7 +123,8 @@
printfd(tcp, tcp->u_arg[0]);
tprints(", ");
} else {
- tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
+ tprint_iov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1], 1,
+ tcp->u_rval);
tprintf(", %lu", tcp->u_arg[2]);
}
return 0;