From: David van Moolenbroek Date: Fri, 30 Nov 2012 10:54:40 +0000 (+0000) Subject: Fix buffer overflows in df(1), format(1) X-Git-Tag: v3.2.1~179 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.dnssec-settime.html?a=commitdiff_plain;h=130b0821219b9e5237cbadd492ddd171294d7cab;p=minix.git Fix buffer overflows in df(1), format(1) --- diff --git a/commands/df/df.c b/commands/df/df.c index 244ead4dc..be07620b8 100644 --- a/commands/df/df.c +++ b/commands/df/df.c @@ -109,7 +109,8 @@ static void readmtab(const char *type) { struct mtab **amt= &mtab, *new; struct stat st; - char devname[128], mountpoint[128], version[10], rw_flag[10]; + char devname[PATH_MAX], mountpoint[PATH_MAX], version[MNTNAMELEN], + rw_flag[MNTFLAGLEN]; if (load_mtab("df") < 0) exit(1); diff --git a/commands/format/format.c b/commands/format/format.c index f5fbbfb28..3c9ccaa5b 100644 --- a/commands/format/format.c +++ b/commands/format/format.c @@ -290,7 +290,7 @@ int main(int argc, char **argv) int verify= 0; struct stat st0, st; char special[PATH_MAX + 1], mounted_on[PATH_MAX + 1]; - char version[10], rw_flag[10]; + char version[MNTNAMELEN], rw_flag[MNTFLAGLEN]; /* Option -v. */ while (argc > 1 && argv[1][0] == '-') {