|
Message-ID: <1476699865-5593-1-git-send-email-rostislav@tuxera.com> Date: Mon, 17 Oct 2016 10:24:25 +0000 From: Rostislav Skudnov <rostislav@...era.com> To: <musl@...ts.openwall.com> Subject: [PATCH] increase buffer size in getmntent to 4096 bytes getmntent fails if the length of the mount entry exceeds the buffer size. The new buffer size matches that of glibc. --- Even after this patch, getmntent may still fail since the device and mount paths may be up to PATH_MAX in length, and the mount options may (theoretically) have unlimited length. The same would happen in glibc, though. src/misc/mntent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/mntent.c b/src/misc/mntent.c index a16d652..5adb583 100644 --- a/src/misc/mntent.c +++ b/src/misc/mntent.c @@ -49,7 +49,7 @@ struct mntent *getmntent_r(FILE *f, struct mntent *mnt, char *linebuf, int bufle struct mntent *getmntent(FILE *f) { - static char linebuf[256]; + static char linebuf[4096]; static struct mntent mnt; return getmntent_r(f, &mnt, linebuf, sizeof linebuf); } -- 2.1.4
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.