Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/pstat fix a buffer size (off by one), and fix all t...



details:   https://anonhg.NetBSD.org/src/rev/bf583406f99d
branches:  trunk
changeset: 961189:bf583406f99d
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Apr 12 05:11:09 2021 +0000

description:
fix a buffer size (off by one), and fix all the comments for the
3 other correctly sized buffers with the same comment/context.

diffstat:

 usr.sbin/pstat/pstat.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r 46acd07b4531 -r bf583406f99d usr.sbin/pstat/pstat.c
--- a/usr.sbin/pstat/pstat.c    Mon Apr 12 04:41:54 2021 +0000
+++ b/usr.sbin/pstat/pstat.c    Mon Apr 12 05:11:09 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pstat.c,v 1.131 2020/10/03 14:01:16 christos Exp $     */
+/*     $NetBSD: pstat.c,v 1.132 2021/04/12 05:11:09 mrg Exp $  */
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)pstat.c    8.16 (Berkeley) 5/9/95";
 #else
-__RCSID("$NetBSD: pstat.c,v 1.131 2020/10/03 14:01:16 christos Exp $");
+__RCSID("$NetBSD: pstat.c,v 1.132 2021/04/12 05:11:09 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -481,7 +481,7 @@
        } dip;
        struct ufsmount ump;
        char flags[sizeof(ufs_flags) / sizeof(ufs_flags[0])];
-       char dev[4 + 1 + 7 + 1]; /* 12bit marjor + 20bit minor */
+       char dev[4 + 1 + 7 + 1]; /* 12bit major + 20bit minor */
        char *name;
        mode_t type;
        dev_t rdev;
@@ -526,7 +526,7 @@
        struct inode inode, *ip = &inode;
        struct ext2fs_dinode dip;
        char flags[sizeof(ufs_flags) / sizeof(ufs_flags[0])];
-       char dev[4 + 1 + 7 + 1]; /* 12bit marjor + 20bit minor */
+       char dev[4 + 1 + 7 + 1]; /* 12bit major + 20bit minor */
        char *name;
        mode_t type;
 
@@ -577,7 +577,7 @@
 {
        struct nfsnode nfsnode, *np = &nfsnode;
        char flags[sizeof(nfs_flags) / sizeof(nfs_flags[0])];
-       char dev[4 + 1 + 7 + 1]; /* 12bit marjor + 20bit minor */
+       char dev[4 + 1 + 7 + 1]; /* 12bit major + 20bit minor */
        struct vattr va;
        char *name;
        mode_t type;
@@ -835,7 +835,7 @@
 ttyprt(struct tty *tp)
 {
        char state[sizeof(ttystates) / sizeof(ttystates[0]) + 1];
-       char dev[2 + 3 + 1 + 5 + 1]; /* 12bit major + 20bit minor */
+       char dev[4 + 1 + 7 + 1]; /* 12bit major + 20bit minor */
        struct linesw t_linesw;
        const char *name;
        char buffer;



Home | Main Index | Thread Index | Old Index