]> granicus.if.org Git - strace/commitdiff
2005-10-21 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Fri, 21 Oct 2005 22:06:46 +0000 (22:06 +0000)
committerRoland McGrath <roland@redhat.com>
Fri, 21 Oct 2005 22:06:46 +0000 (22:06 +0000)
* util.c (printpathn): Cap N at sizeof path - 1.

util.c

diff --git a/util.c b/util.c
index 395492250a47d761cc2aa2cf810dc25ab99f8b84..4b0a0616efab6ec7fa0309785f52e92c64a58371 100644 (file)
--- a/util.c
+++ b/util.c
@@ -424,6 +424,9 @@ struct tcb *tcp;
 long addr;
 int n;
 {
+       if (n >= sizeof path)
+               n = sizeof path - 1;
+
        if (addr == 0)
                tprintf("NULL");
        else    if (umovestr(tcp, addr, n, path) < 0)