]> granicus.if.org Git - procps-ng/commitdiff
protect against BSD pty w/ 20-bit minor
authoralbert <>
Tue, 24 Feb 2004 04:14:36 +0000 (04:14 +0000)
committeralbert <>
Tue, 24 Feb 2004 04:14:36 +0000 (04:14 +0000)
free.1
proc/devname.c
top.1

diff --git a/free.1 b/free.1
index 203ca613826fc502014dbb477fe4df6939398147..954c8d9c153033a732dcf88207cb3ecc1e738a47 100644 (file)
--- a/free.1
+++ b/free.1
@@ -36,6 +36,8 @@ The \fB\-V\fP displays version information.
 
 .SH "SEE ALSO"
 .BR ps (1),
+.BR slabtop (1),
+.BR vmstat (8),
 .BR top(1)
 
 .SH AUTHORS
index 78c00cd354a5652377e8aef1ae60bc2bb76a3db1..d36848167649a8bfb50ece101f7fda19ad1c7198 100644 (file)
@@ -146,6 +146,7 @@ static int guess_name(char *restrict const buf, unsigned maj, unsigned min){
     }
     tmpmin = min & 0x3f;  /* FALL THROUGH */
   case   3:      /* /dev/[pt]ty[p-za-o][0-9a-z] is 936 */
+    if(tmpmin > 255) return 0;   // should never happen; array index protection
     t0 = "pqrstuvwxyzabcde"[tmpmin>>4];
     t1 = "0123456789abcdef"[tmpmin&0x0f];
     sprintf(buf, "/dev/tty%c%c", t0, t1);
diff --git a/top.1 b/top.1
index 4520090e4c60e88425e8de406ee18d664c309cb7..e892289e1a329dcedf1a01ff69ca24ab9a7978d9 100644 (file)
--- a/top.1
+++ b/top.1
@@ -1214,6 +1214,7 @@ With invaluable help from:
 .BR free (1),
 .BR ps (1),
 .BR uptime (1),
+.BR slabtop (1),
 .BR vmstat (8),
 .BR w (1).