2005-10-21  Roland McGrath  <roland@redhat.com>

	* util.c (printpathn): Cap N at sizeof path - 1.
diff --git a/util.c b/util.c
index 3954922..4b0a061 100644
--- a/util.c
+++ b/util.c
@@ -424,6 +424,9 @@
 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)