Fix buffer overflows in df(1), format(1)

This commit is contained in:
David van Moolenbroek 2012-11-30 10:54:40 +00:00
parent 179261a9b6
commit 130b082121
2 changed files with 3 additions and 2 deletions

View file

@ -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);

View file

@ -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] == '-') {