From: Roland McGrath Date: Fri, 21 Oct 2005 22:06:46 +0000 (+0000) Subject: 2005-10-21 Roland McGrath X-Git-Tag: v4.5.18~329 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b15c4e47ff5b2b0dd71fa10472eafb1d5abf4c5f;p=strace 2005-10-21 Roland McGrath * util.c (printpathn): Cap N at sizeof path - 1. --- diff --git a/util.c b/util.c index 39549225..4b0a0616 100644 --- 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)