mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] increase buffer size in getmntent to 4096 bytes
@ 2016-10-17 10:24 Rostislav Skudnov
  2016-10-17 12:48 ` Natanael Copa
  0 siblings, 1 reply; 3+ messages in thread
From: Rostislav Skudnov @ 2016-10-17 10:24 UTC (permalink / raw)
  To: musl

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-17 20:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-17 10:24 [PATCH] increase buffer size in getmntent to 4096 bytes Rostislav Skudnov
2016-10-17 12:48 ` Natanael Copa
2016-10-17 20:29   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).