]> granicus.if.org Git - strace/blobdiff - io.c
io: handle data_size of -1 as unlimited data in print_iovec
[strace] / io.c
diff --git a/io.c b/io.c
index 907f9d24718cc27c86fa55cd765053518337d488..8a93cb89c19b207da1aa26a73705f3e8bfa01375 100644 (file)
--- a/io.c
+++ b/io.c
@@ -85,13 +85,15 @@ print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
                case IOV_DECODE_STR:
                        if (len > c->data_size)
                                len = c->data_size;
-                       c->data_size -= len;
+                       if (c->data_size != (unsigned long) -1L)
+                               c->data_size -= len;
                        printstr(tcp, iov[0], len);
                        break;
                case IOV_DECODE_NETLINK:
                        if (len > c->data_size)
                                len = c->data_size;
-                       c->data_size -= len;
+                       if (c->data_size != (unsigned long) -1L)
+                               c->data_size -= len;
                        decode_netlink(tcp, iov[0], iov[1]);
                        break;
                default: